Differentiation and Integration Examples
Use these examples for syntax.
Differentiation Examples
The capital "D" produces a statement of what you want to do and the value(%) computes the derivative.
> | Diff(3*x*sin(4*x^2),x); |
> | value(%); |
The small "d" computes the derivative immediately.
> | diff(3*x*sin(4*x^2),x); |
> | diff((2*x^3-4*x)*(sin(2*x))^2,x); |
Here is a second derivative.
> | diff(3*x*sin(4*x^2),x,x); |
> | Diff(3*x*sin(4*x^2),x,x); |
> | value(%); |
In the example below the "a" is treated as a constant.
> | diff(a*x*sin(4*a*x^2),x); |
This time the "x" is being treated as a constant.
> | diff(a*x*sin(4*a*x^2),a); |
Here is a third derivative.
> | diff(3*x*sin(4*x^2),x,x,x); |
You can give a name to the function you wish to differentiate.
> | f:=sin(3*x^2)/(2*x^3+4*x); |
> | diff(f,x); |
> | poly1:=5*x^4-4*x^3+3*x^2-2*x+1; |
> | diff(poly1,x,x); |
> | diff(ln(x^2+x),x); |
> | diff(ln(x^2+x),x,X); |
Note the capital "X" above and the result. The second differentiation was treated like differentiating a constant.
> | diff(ln(x^2+x),x,x); |
> | Diff(exp(x),x); |
> | diff(exp(x),x); |
> | diff((2*x)^(x^2),x); |
Integration Examples
Notice the difference between "Int" and "int".
> | Int(x*sqrt(3*x^2+4),x); |
> | value(%); |
> | int(x*sqrt(3*x^2+4),x); |
Here is a definite integral.
> | Int(x*sqrt(3*x^2+4),x=0..1); |
> | value(%); |
> | int(x*sqrt(3*x^2+4),x=0..1); |
You can use evalf to approximate.
> | evalf(%); |
> | Int(x*exp(x^2+2),x); |
> | int(x*exp(x^2+2),x); |
Note that Maple does not add the arbitrary constant in an indefinite integration.
> | int(1/x,x); |
> | Int(1/x,x=1..5); |
> | int(1/x,x=1..5); |
> | Int(1/x,x=1..5); |
> | evalf(%); |
> | evalf(ln(5)); |
> | Int(cos(x^2),x=0..1); |
> | evalf(%); |
Does the answer above look reasonable from an area interpretation?
> | with(plots):plot(cos(x^2),x=0..1); |
> |