% Problem 7 clear close all % a) % We first declare x symbolic with the syms command, and then apply diff. syms x diff(7*x^3 + 3*x^2 - 2*x + 1) ans = 21*x^2+6*x-2 % This can easily be checked by "hand-calculation". % b) diff((x + 1)/(x^2 + 1)) ans = 1/(x^2+1)-2*(x+1)/(x^2+1)^2*x simplify(ans) ans = -(x^2-1+2*x)/(x^2+1)^2 % Let's use the pretty command to produce an answer written in mathematical % notation. pretty(ans) 2 x - 1 + 2 x - ------------ 2 2 (x + 1) % c) diff(cos(x^2 + 1)) ans = -2*sin(x^2+1)*x % d) diff(asin(2*x + 3)) ans = 1/(-2-x^2-3*x)^(1/2) pretty(ans) 1 ------------------ 2 1/2 (-2 - x - 3 x) % e) diff(sqrt(1 + x^4)) ans = 2/(1+x^4)^(1/2)*x^3 pretty(ans) 3 x 2 ----------- 4 1/2 (1 + x ) % f) syms a diff(a^x) ans = a^x*log(a) % Here we have also had to declare a symbolic. % g) diff(atan(x)) ans = 1/(x^2+1) echo off