Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

given: f(x)= 12x^3 +5x^2 -2x+ 3, g(x)= 3x^2 -7x +4. write a MATLAB script file t

ID: 1826404 • Letter: G

Question

given: f(x)= 12x^3 +5x^2 -2x+ 3, g(x)= 3x^2 -7x +4. write a MATLAB script file that computes the following: 1.f(x)+g(x). 2. f(x)*g(x). 3.f(x)/g(x). 4. roots of f(x). 5. g(5). 6. f'(x). PLEASE SOLVE THIS USING MATLAB CODE

Explanation / Answer

>> syms x >> f=sym(12*x^3+5*x^2-2*x+3) f = 12*x^3 + 5*x^2 - 2*x + 3 >> g=sym(3*x^2-7*x+4) g = 3*x^2 - 7*x + 4 >> f+g ans = 12*x^3 + 8*x^2 - 9*x + 7 >> f*g ans = (3*x^2 - 7*x + 4)*(12*x^3 + 5*x^2 - 2*x + 3) >> f/g ans = (12*x^3 + 5*x^2 - 2*x + 3)/(3*x^2 - 7*x + 4) >> simplify(ans) ans = 4*x - 18/(x - 1) + 113/(3*x - 4) + 11 >> solve(f) ans = - 97/(1296*(6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)) - (6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3) - 5/36 (3^(1/2)*(97/(1296*(6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)) - (6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3))*i)/2 + 97/(2592*(6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)) + (6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)/2 - 5/36 97/(2592*(6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)) - (3^(1/2)*(97/(1296*(6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)) - (6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3))*i)/2 + (6497/46656 - (5311^(1/2)*279936^(1/2))/279936)^(1/3)/2 - 5/36 >> g=@(x)(3*x^2-7*x+4) g = @(x)(3*x^2-7*x+4) >> g(5) ans = 44 >> diff(f,x) ans = 36*x^2 + 10*x - 2