maple_diff.mw

> f:=x^n;
 

x^n 

> fx:=diff(f,x);
 

x^n*n/x 

> f:=sin(x);
 

sin(x) 

> fx:=diff(f,x);
 

cos(x) 

> f:=x^2*sin(x);
 

x^2*sin(x) 

> fx:=diff(f,x);
 

2*x*sin(x)+x^2*cos(x) 

> f:=arctan(2/x);
 

arctan(2/x) 

> fx:=diff(f,x);
 

-2/(x^2*(1+4/x^2)) 

> fx:=simplify(fx);
 

-2/(x^2+4) 

> f:=1/x;
 

1/x 

> fx:=diff(f,x);
 

-1/x^2 

> fxx:=diff(f,x,x);
 

2/x^3 

> fxxx:=diff(f,x,x,x);
 

-6/x^4 

> fxxxx:=diff(f,x,x,x,x);
 

24/x^5 

> f:=1/sqrt(1-x);
 

1/(1-x)^(1/2) 

> fx:=diff(f,x);
 

1/2/(1-x)^(3/2) 

> fxx:=diff(f,x,x);
 

3/4/(1-x)^(5/2) 

> fxxx:=diff(f,x,x,x);
 

15/8/(1-x)^(7/2) 

> fxxxx:=diff(f,x,x,x,x);
 

105/16/(1-x)^(9/2) 

> fxxxxx:=diff(f,x,x,x,x,x);
 

945/32/(1-x)^(11/2) 

> f:=piecewise(x>0,x^2,x^3);
 

piecewise(0 < x, x^2, x^3) 

> fx:=diff(f,x);
 

piecewise(x <= 0, 3*x^2, 0 < x, 2*x) 

> fxx:=diff(f,x,x);
 

piecewise(x < 0, 6*x, x = 0, undefined, 0 < x, 2) 

> plot([f,fx,fxx],x=-3..3,y=-5..5,color=[black,black,black],linestyle=[SOLID,DASH,DOT],legend=["f","fx","fxx"],axes=boxed);
 

Plot 

>