MATLAB Code:
close all
clear
clc
fprintf('Part
(a)\n-----------------------------------------------------\n')
syms x
y = 5*x^4 + 3*x^3 + 6*x^2 - 7*x + 2;
fprintf('y(x) = '), disp(y)
y_derivative = diff(y,x);
fprintf('y''(x) = '), disp(y_derivative)
fprintf('\nPart
(b)\n-----------------------------------------------------\n')
I = integral(@(x) 5*x.^4 + 3*x.^3 + 6*x.^2 - 7*x + 2, -2, 6);
fprintf('Integration Result: %f\n', I)
Output:
Part (a)
-----------------------------------------------------
y(x) = 5*x^4 + 3*x^3 + 6*x^2 - 7*x + 2
y'(x) = 20*x^3 + 9*x^2 + 12*x - 7
Part (b)
-----------------------------------------------------
Integration Result: 9120.000000
Get Answers For Free
Most questions answered within 1 hours.