Partial Differentiation and Multiple Integration Examples
Use these examples for syntax.
Partial Differentiation Examples
The capital "D" produces a statement of what you want to do and the value(%) computes the partial derivative.
> | Diff(3*x*sin(4*x*y^2),x); |
> | value(%); |
The small "d" computes the partial derivative immediately.
> | diff(3*x*sin(4*x*y^2),x); |
> | diff((2*y^3-4*x)*(sin(2*y))^2,y); |
Here is a second partial derivative.
> | diff(3*y*sin(4*y*x^2),x,x); |
> | Diff(3*y*sin(4*y*x^2),x,x); |
> | value(%); |
In the example below we are looking at mixed second partial derivatives. Note how they compare (equal).
> | Diff(y*x*sin(4*y*x^2),x,y); |
> | value(%); |
> | Diff(y*x*sin(4*y*x^2),y,x); |
> | value(%); |
This time we have a function of three variables.
> | Diff(x*y*sin(4*z*x^2),z); |
> | value(%); |
Here are some third partial derivatives.
> | Diff(3*x*y*sin(4*x^2),x,x,x); |
> | value(%); |
> | Diff(3*x*y*sin(4*x^2),x,y,x); |
> | value(%); |
> | diff(3*x*y*sin(4*x^2),x,x,y); |
You can give a name to the function you wish to differentiate.
> | f:=sin(3*x^2)/(2*y^3+4*x); |
> | diff(f,x); |
> | diff(f,y); |
> | poly1:=5*x^4-4*x^3*y+3*x^2*y^2-2*x*y^3; |
> | diff(poly1,x,x,y); |
> | diff(ln(x^2+y),x,y); |
> | diff(y*ln(x^2+x),y,y); |
Here is an alternate notation.
> | diff(y*ln(x^2+x),x,x,x,x); |
> | diff(y*ln(x^2+x),x$4); |
> | Diff(exp(x),x$5); |
> | value(%); |
> | Diff((2*x)^(y^2),x,y); |
> | value(%); |
Integration Examples
Notice the difference between "Int" and "int". In the indefinite integration you will need to know that you must add an arbitrary function of the "other" variable.
> | Int(x*sqrt(3*y^2+4),x); |
> | value(%); |
> | Int(x*sqrt(3*y^2+4),y); |
> | value(%); |
Here is an iterated double integral.
> | Int(Int(y*sqrt(3*x+4),x=0..1),y=0..1); |
> | value(%); |
> | int(int(y*sqrt(3*x+4),x=0..1),y=0..1); |
You can use evalf to approximate.
> | evalf(%); |
> | Int(Int(x*exp(x^2+2),x=0..y),y=0..1); |
> | value(%); |
> | evalf(%); |
Here are some iterated triple integrals (P 986 # 1, 4, 10, 12).
> | Int(Int(Int(x+y+z,x=0..1),y=0..2),z=0..3); |
> | value(%); |
> | int(int(int(x+y+z,x=0..1),y=0..2),z=0..3); |
> | Int(Int(Int(z,z=0..sqrt(y^2-9*x^2)),x=0..y/3),y=0..9); |
> | value(%); |
> | Int(Int(Int(y,z=2*x^2+y^2..4-y^2),y=0..sqrt(2-x^2)),x=0..sqrt(2)); |
> | value(%); |
> | Int(Int(Int(z*exp(-x^2*y^2),x=0..6-2*y-3*z),z=0..2-2*y/3),y=0..3); |
> | evalf(%); |
Observe that Maple cannot evaluate the iterated triple integral above completely to give an exact analytical result.
> | int(int(int(z*exp(-x^2*y^2),x=0..6-2*y-3*z),z=0..2-2*y/3),y=0..3); |
> | evalf(%); |
The best we can do is approximate.