VII Integration
Part I Integration
Usage Overview
Functions | Brief Usage Descriptions and Examples |
---|---|
itg | Find an antiderivative of f(x) by \(∫f(x)dx\) by "itg;f(x);x" or "itg(f(x),x)". Evaluate definite integrals \(∫_a^bf(x)dx\) by "itg;f(x);x;a;b" or "itg(f(x),x,a,b)". Evaluate double integrals \(∫_c^d∫_a^bf(x,y)dxdy\) by "itg;f(x,y);x;a;b;y;c;d". Evaluate triple integrals \(∫_u^v∫_c^d∫_a^bf(x,y,z)dxdydz\) by "itg;f(x,y,z);x;a;b;y;c;d;z;u;v". itg;1;x || itg;x;x || itg;a;x || itg;x**(1/2);x;0;1 || itg;log(x);x;1;2 || itg;1/(x+1);x || itg;1/(x+1);x;0;2 || itg;1/(x+1);x;-2;2 || itg;exp(-x);x;0;oo || itg;x*exp(-x**2);x;0;oo || itg;cos(x);x;0;pi || itg;sin(x);x;0;2*pi || itg;tan(x);x || itg;sin(x)*cos(x);x;0;pi || itg;pi*(x**2+1);x;0;1 || itg;1;x;1;3;y;2;4 || itg;x;x;0;3;y;-2;4 || itg;y;x;-2;0;y;-3;5 || itg;x*y;x;0;4;y;1;7 || itg;2*x*y+1/y;y;1;x || itg;z;x;0;y**2;y;0;1 || itg;x*y;x;1/y**2;y+1;y;1;3 || itg;x/z;y;x;z || itg;1;x;0;2;y;1;3;z;0;1 || itg;y**2*x;x;0;1-y;y;2;3 || itg;y;x;0;exp(y**2);y;0;1 || itg;1;y;cos(x);sin(x);x;pi/4;5*pi/4 || itg;r**2*cos(t);r;0;sin(t);t;0;pi/2 || itg;r*sin(t)**2;r;0;1+cos(t);t;0;2*pi || itg;r**2*sin(s);r;0;cos(s);s;0;pi/4;t;0;pi ||. |
nit | Approximate \(∫_a^bf(x)dx\) by "nit;f(x);x;a;b;n" for n points by left, right, midpoint Riemmann sum, Simpson's rule and trapezoidal rule. Carry out numerical integration by "nit;f(x);x;a;b" (single), "nit;f(x,y);x;g(y);h(y);y;c;d" (double), and "nit;f(x,y,z);z;g(x,y);h(x,y);y;u(x);w(x);x;a;b" (triple). nit;cos(x**2);x;0;pi/2;30 || nit;cos(x**2);x;0;pi/2 || nit;(1+1**2)**(1/2);x;-1;1;30 || nit;(1+1**2)**(1/2);x;-1;1 || nit;(1+cos(x)**2)**(1/2);x;-pi/2;pi/2;30 || nit;(1+cos(x)**2)**(1/2);x;-pi/2;pi/2 || nit;r*sin(t)**2;r;0;1+cos(t);t;0;2*pi || nit;r**2*sin(s);r;0;cos(s);s;0;pi/4;t;0;pi ||. |
jcb | Find Jacobian matrix and determinant by "jcb(a,b)", where vector "a" lists component functions and "b" lists the variables to which derivatives are taken. mat;jcb(a,b);a;[u-2*v,3*u+v];b;[u,v] || mat;jcb(u,v);u;[r*sin(s)*cos(t),r*sin(s)*sin(t),r*cos(s)];v;[r,s,t] || mat;det(jcb(u,v));u;[r*cos(t),r*sin(t),z];v;[r,t,z] || mat;det(jcb(u,v));u;[r*sin(s)*cos(t),r*sin(s)*sin(t),r*cos(s)];v;[r,s,t] ||. |
Table of Contents: Part I
Back to Part II. Multiple Integrals
1 Antiderivatives
Definition and Basic Rules for Indefinite Integrals
Definition of antiderivatives and indefinite integrals: [itg; f(x); x], [itg(f(x), x)]A function \(F\) is an antiderivative of \(f\) on an open interval \((a,b)\) if \(F'(x)=f(x)\) for all \(x∈(a, b)\). Antiderivatives differ by a constant, and the set of all antiderivatives of \(f\) is denoted as an indefinite integral \(\int f(x)dx=F(x)+C\).
Evaluating antiderivatives At least three components "∫, f(x), dx" are required for finding an antiderivative, where "∫" stands for integration (the type of operation), "f(x)" for the integrand function, and "dx" for the integration variable. Thus, to find an antiderivative of f(x), use "itg; f(x); x", where "itg" (integration) is the operation name, "f(x)" the expression of the integrand, and "x" the variable of integration. Be aware that some functions are not integrable, so you may not get their final results.
Attention Also write "itg(f(x), x)" to find an antiderivatives of f(x), and combine with "dif" module to verify the basic identities ∫ f'(x)dx = f(x) + C by "itg(dif(f(x), x), x)", and [∫ f(x)dx]' = f(x) by "dif(itg(f(x), x), x)" for any integrable function f(x), because the effects of these two inverse operations cancel each other. If f(x) = cos(x), check itg(dif(cos(x),x),x) || dif(itg(cos(x),x),x) ||.
Antiderivatives and derivatives are inverse operations In general, \(∫\frac{d}{dx}f(x)dx=f(x)+C\) and \(\frac{d}{dx}∫f(x)dx=f(x)\) because antiderivatives and derivatives are inverse operations. Use itg(dif(f(x),x),x) || and dif(itg(f(x),x),x) || to verify these basic identities.
Examples Verify basic some basic formulas itg;0;x || itg;1;x || itg;x**r;x || itg;1/x;x || itg;exp(x);x || itg;a**x;x || itg;sin(x);x || itg;cos(y);y || itg;tan(z);z || itg;cot(x);x || itg sec(x);x || itg;csc(x);x || itg;sec(x)**2;x || itg;csc(x)**2;x || itg;sec(x)*tan(x);x || itg;csc(x)*cot(x);x || itg;1/(1-x**2)**(1/2);x || itg;1/(1+x**2);x || itg;1/(x*(x**2-1)**(1/2));x ||.
Examples Verify basic identities itg(dif(2*x,x),x) || itg(dif(exp(-x),x),x) || dif(itg(cos(x/2),x),x) || dif(itg(log(x)**2,x),x) ||.
Basic integration rules Use basic integration rules to evaluate antiderivatives.
Power rule \(\int x^ndx=\frac{1}{n+1}x^{n+1}+C\) for \(n\ne -1\)
Sum and difference rule \(\int [(f(x)\pm g(x)]dx=\int f(x)dx \pm \int g(x)dx\)
Constant multiple rule \(\int cf(x)dx=c\int f(x)dx\) for any constant \(c\)
Examples Verify these rules by itg(x**n,x) || itg(c*f(x),x) || itg(f(x)+g(x),x) || itg(a*f(x)+b*g(x),x)-a*itg(f(x),x)-b*itg(g(x),x) || itg(2*dif(f(x),x),x) || dif(itg(f(x),x)+c,x) ||.
Examples
(1) itg;5*x**(3/2);x || gives the output for \(\int 5x^{\frac{3}{2}}dx=2x^{\frac{5}{2}}\).
(2) Check the outputs for other examples by itg;-6;y || itg;2*x;x || itg;0;u || itg;2*z**(1/3);z || itg;1/x+x**(-3/4);x || itg;5-2*t**(-3)+(2*t)**(1/2);t || itg;csc(v)**2+v**3;v || itg;sin(x)-cos(x);x || itg;exp(x)-3**x;x || itg;3/x-5*x**(-4)+a*x**6;x || itg;3/(1-x**2)**(1/2);x || itg;2/x-3/(1+x**2)+4*tan(x)*sec(x);x || itg;4*x**(-2/3)+5*x**(4/3);x ||
itg;3**x-(2/3)**x-5/(2*x)+(2*x)**(-3);x || itg;1+tan(x)**2;x || itg;(sec(s)+csc(s))**2;s || itg;(tan(s)+cot(s))**2;s || itg;(sin(t)+cos(t))**2;t ||.
Examples If an integrand involves variables other than the integration variable, they are treated as constants. || itg;a;x || itg;x**r+b;x || itg;2*x+3*y;x|| itg;3*x*y**2;y || itg;x**2+y**2;z || itg;sin(pi)+x;x || itg;exp(pi);x || itg;3**(pi)*e;x || itg;2*sin(x)-3*cos(y);y || itg;exp(2*y)+3*a**x;x ||.
Integration Techniques
Integration by substitution is used for integration involves composite functions. If \(F[g(x)]\) is an antiderivative of \(f[g(x)]g'(x)\), then \(\int f[g(x)]g'(x)dx=\int f(u)du=F(u)+C=F[g(x)]+C\) for \(u=g(x)\).
Example To evaluate \(∫(2x+3)^7dx\), let \(u=2x+3\). Then \(du=2dx⇒dx = \frac{du}{2}\) and \(∫(2x+3)^7dx=∫u^7\frac{du}{2}\)\(=\frac{1}{2(7+1)}u^{7+1}=\frac{u^8}{16}+C=\frac{(2x+3)^8}{16}+C\). Check itg;(2*x+3)**7;x || (2*x+3)**8/16;ep ||.
Example itg(cos(x**3)*dif(x**3,x),x) || shows \(∫\cos(x^3)\frac{d}{dx}x^3dx=\sin(x^3)\).
Examples itg;exp(-x);x || itg;exp(-2*x) || itg;sin(-3*x);x || itg;1/(x+1);x || itg;2/(1-3*a);a || itg;4/(2*b-5);b || itg;x/(1+x**2);x || itg;sin(2*x+3);x || itg;(3*x-5)**(-9);x || itg;(1-2*t)**3*t;t || itg;1/(x-3)**(1/2);x || itg;3*x/(x+2)**(1/2);x || itg;(s**2+2*s+1)**(1/3);s || itg;(x**2+1)**3*x**4;x || itg;x*(2*x+3)**(1/2);x || itg;t*(a*t+b)**(1/2);t || itg;(x-1)**(1/2)*x**2;x || itg;cos(z)*sin(z)*(1+cos(z)**2)**(1/2);z || itg;x**2/(1+x**2)**(1/2);x || itg;y**2/(2+y**2)**(1/2);y || itg;1/(1+sin(x));x || itg;1/(1-cos(x));x || itg;1/(a**2-x**2)**(1/2);x || itg;1/(a**2+x**2);x || itg;1/(x*(x**2-a**2)**(1/2));x || itg;w/(w**2+3)**(1/2);w || itg;x*sin(x**2);x || itg;1/(y-1)**0.5;y || itg;w/(3*w+1)**(1/2);w ||.
Integration by parts The formula \(\int uv'dx=uv-\int u'vdx\) or \(\int udv=uv-\int vdu\) results from integrating both sides of the equation \((uv)'=u'v+uv'\).
Examples \(\int\ln xdx=x\ln x-\int xd(\ln x)\)\(=x\ln x-x\) by itg;log(x);x ||. Check itg;exp(x)*cos(x);x || itg;x**2*exp(-x);x || itg;x**3*exp(x);x || itg;x**3*log(x);x || itg;acos(x);x || itg;x**3*sin(x);x || itg;exp(2*x)*sin(x/2);x || itg;sin(x)**3;x || itg;cos(x)**5;x || itg;x*sin(x)**2;x || itg;log(t)/t**3;t || itg;x*atan(x);x || itg;x**2*asin(x);x || itg;x**4*exp(2*x);x || itg;x**2/(3+x**2)**(1/2);x || itg;x**5*log(x);x || itg;x**5*log(x)**2;x || itg;sin(x)**3*cos(x)**6;x || itg;exp(x**(1/2));x || itg;x*cos(15*x);x || itg;sec(x)**3;x || itg;x**3*cos(4*x);x || itg;x**3*(1+x)**(1/2);x || itg;x**2/(2+x**2)**2;x || itg;cos(x**(1/2));x || itg;sin(x**(1/3));x || itg;x*(4*x-3)**4;x || itg;acos(x)**2;x || itg;x**3*log(x)**4;x || itg;x*asin(x);x || itg;asin(x);x || itg;z*cos(z);z || itg;u*exp(u);u || itg;u**2*exp(u);u || itg;tan(t);t || itg;s*2**s;s || itg;(sec(t)**2+csc(t)**2)**2;t ||.
Examples itg;cos(x)**2;x || itg;sin(a*t)**2;t || itg;sin(x)**4*cos(x)**5;x || itg;sin(x)**4;x || itg;tan(x)**2*sec(x)**4;x || itg;cot(t)**3*csc(t)**5;t || itg;sin(2*x)*cos(4*x);x || itg;sin(pi*x)*cos(3*pi*x);x || itg;sin(2*x)**3;x || itg;cos(3*t)**2;t || itg;sec(x)**3;x || itg;acos(1/y);y ||.
Trigonometric integrands and substitutions Integration involving square root functions of the form \(\sqrt{a^2-x^2}\), \(\sqrt{a^2+x^2}\), and \(\sqrt{x^2-a^2}\) for \(a \ge 0\) can be obtained by removing the radical form and integrating trigonometric functions.
For form \(\sqrt{a^2-x^2}\), let \(x=a\sin t\) for \(-\frac{\pi}{2}\le t \le \frac{\pi}{2}\). Then \(dx=a\cos tdt, \sqrt{a^2-x^2}=a\cos t\).
For form \(\sqrt{a^2+x^2}\), let \(x=a\tan t\) for \(-\frac{\pi}{2}< t < \frac{\pi}{2}\). Then \(dx=a\sec^2tdt, \sqrt{a^2+x^2}=a\sec t\).
For form \(\sqrt{x^2-a^2}\), let \(x=a\sec t\). Then \(dx=a\sec t\tan tdt, \sqrt{x^2-a^2}=a|\tan t|=a\tan t\) if \(0 \le t < \frac{\pi}{2},\sqrt{x^2-a^2}=-a\tan t\) if \(\frac{\pi}{2} < t \le \pi\). We need to specify the interval of \(t\) for evaluating definite integrals.
Example To evaluate \(\int\frac{\sqrt{4-x^2}}{x^2}dx\), let \(x=2\sin t\),\(dx=2\cos tdt\) and the integral becomes \(\int\frac{2\cos t}{4\sin^2t}2\cos tdt\)\(=\int(\csc^2t-1)dt=-\cot t-t+c=-\frac{\sqrt{4-x^2}}{x}-\sin^{-1}\frac{x}{2}+c\) using the right triangle method. Check the result by itg;(4-x**2)**(1/2)/x**2;x ||.
Examples itg;(x**2-1)**(1/2)/x;x || itg;(x**2+9)**(1/2);x || itg;x**2*(x**2+9)**(1/2);x || itg;(x**2+9)**(1/2)/x;x || itg;(x**2-8)**(1/2)/x**2;x || itg;1/(x*(16-4*x**2)**(1/2));x || itg;1/(x**2*(16-4*x**2)**(1/2));x || itg;x/(3-2*x**2)**(1/2);x || itg;x**2/(3-2*x**2)**(1/2);x || itg;1/(x*(3-2*x**2)**(1/2));x || itg;x**2/(1-x**2)**(3/2);x || itg;x*acos(x);x || itg;1/(x**2+4)**2;x ||.
Rational functions and partial fractions method The partial fraction method can be used to evaluate integrals of rational functions \(\frac{P(x)}{Q(x)}\), a quotient of two polynomials \(P(x)\) and \(Q(x)\ne 0\). If the denominator \(Q(x)\) factors as a product of distinct linear factors of the form \(ax+b\), then each distinct linear factor becomes a terms in the sum of partial fractions, \(\frac{P(x)}{(a_1x+b_1)(a_2x+b_2)\cdots (a_nx+b_n)}=\frac{A_1}{a_1x+b_1}+\frac{A_2}{a_2x+b_2}+\cdots +\frac{A_n}{a_nx+b_n}\) for some constants \(A_1,A_2,\cdots, A_n\).
Example Rewrite the fraction into \(\frac{x+1}{x^2+x-2}=\frac{x+1}{(x-1)(x+2)}=\frac{A_1}{x-1}+\frac{A_2}{x+2}=\frac{A_1(x+2)+A_2(x-1)}{(x-1)(x+2)}\). Solve the equation \(x+1=A_1(x+2)+A_2(x-1)\) for \(A_1=\frac{2}{3},A_2=\frac{1}{3}\) by setting \(x=-2\) and \(x=1\) one at a time. Check the result of the integral by itg;(x+1)/(x**2+x-2);x || or the sum of itg;2/(3*(x-1));x || itg;1/(3*(x+2));x ||.
Examples itg;1/(x**2-4);x || itg;(x+1)/x*(x-1)*(x+2);x || itg;(2*x+3)/(x**2-1)*(x**2-9);x || itg;x*(x-3)/((x**2-6)*(x**2-8)*(x+1));x || itg;(x**2+1)/(x**3-2*x**2-x+2);x ||.
If \(Q(x)\) has one or more repeated linear factors, then each repeated factor involves the sum of the following terms in the partial fractions, \(\frac{P(x)}{(a_1x+b_1)^{K_1}(a_2x+b_2)^{K_2}\cdots (a_nx+b_n)^{K_n}}=\displaystyle\sum_{i=1}^n[ \frac{B_1}{a_ix+b_i}+\frac{B_2}{(a_ix+b_i)^2}+\cdots+ \frac{B_{K_i}}{(a_ix+b_i)^{K_i}}]\) for some constants \(B_1,B_2, \cdots, B_{K_i}, i=1,2,\cdots, n\).
Example \(\frac{2x-1}{(x+1)(x-2)^2}=\frac{A}{x+1}+\frac{B_1}{x-2}+\frac{B_2}{(x-2)^2}\), where \(A=-\frac{1}{3},B_1=\frac{1}{3}, B_2=1\). The integral is by itg;(2*x-1)/((x+1)*(x-2)**2);x || or by the sum of three integrals.
Examples itg;(x**2+2)/(x*(x-1)*(x+3)**2);x || itg;x/((x-3)**2*(x+3)**2);x ||.
Irreducible quadratic factors have the form of \(ax^2+bx+c\) for \(b^2< 4ac\). If \(Q(x)\) has distinct irreducible quadratic factors, \(\frac{P(x)}{(a_1x^2+b_1x+c_1)(a_2x^2+b_2x+c_2)\cdots (a_nx^2+b_nx+c_n)}=\frac{A_1x+B_1}{a_1x^2+b_1x+c_1} +\frac{A_2x+B_2}{a_2x^2+b_2x+c_2}+\cdots+\frac{A_nx+B_n}{a_nx^2+ b_nx+c_n}\) in which each factor contributes one term in the sum for some suitable constants \(A_1,B_1,A_2,B_2,\cdots,A_n,B_n\).
Example \(\frac{x+2}{x(x^2+3)}=\frac{a}{x}+\frac{bx+c}{x^2+3}=\frac{a(x^2+3)+x(bx+c)}{x(x^2+3)}\). Solve the equation \(x+2=x^2(a+b)+cx+3a\) for \(a=\frac{2}{3},b=-\frac{2}{3},c=1\) by setting \(x=0\). The integral is by itg;(x+2)/(x*(x**2+3));x || itg;1/((x**2+1)*(x**2+4));x || itg;1/(x**3+1);x ||.
Examples In particular, the formula \(\int\frac{dx}{x^2+a^2}=\frac{1}{a}\tan^{-1}\frac{x}{a}+c\) or \(\int\frac{dx}{x^2+a}= \frac{1}{\sqrt{a}} \tan^{-1}\frac{x}{\sqrt{a}}+c\) is useful for irreducible quadratic factors \(x^2+a^2\) or \(x^2+a\) for \(a>0\). Check itg;1/(x**2+1);x || itg;1/(x**2+2);x || itg;1/(x**2+3);x || itg;1/(x**2+4);x || itg;2/(3*(x**2+5));x || itg;3/((x+2)**2+7);x || itg;1/(x**2+2*x+5);x || itg;3/(x**2+4*x+5);x ||.
If \(Q(x)\) has a repeated irreducible quadratic factor \((ax^2+bx+c)^K\) for \(K>1\) along with other factors, for example, \(\frac{P(x)}{x(ax^2+bx+c)^K}=\frac{A}{x}+\frac{A_1x+B_1}{ax^2+bx+c}+\frac{A_2x+B_2}{(ax^2+bx+c)^2}+\cdots+\frac{A_Kx+B_K}{(ax^2+bx+c)^K}\).
Example \(\frac{16}{x(x^2+4)^2}=\frac{a}{x}+\frac{bx+c}{x^2+4}+\frac{mx+n}{(x^2+4)^2}\). Simplify the numerator by a*(x**2+4)**2+(b*x+c)*x*(x**2+4)+x*(m*x+n);ep || and match the coefficients for \(a=1,b=-1,c=0,m=-4,n=0\). Check and compare the results by itg;16/(x*(x**2+4)**2);x || itg;1/x-x/(x**2+4)-4*x/(x**2+4)**2;x ||.
improper rational function For a rational function \(\frac{P(x)}{Q(x)}\), if the degree of \(P(x)\) is greater than that of \(Q(x)\), we call it an improper rational function, and can be written as \(\frac{P(x)}{Q(x)}=g(x)+\frac{R(x)}{Q(x)}\) by long division, where \(g(x)\) is a polynomial and \(\frac{R(x)}{Q(x)}\) is a proper rational function. If \(\frac{R(x)}{Q(x)}\) cannot be evaluated directly, use the method of partial fractions. For fractions with irreducible quadratic factors, complete the square, and then evaluate them by trigonometric substitution.
Examples itg;x**4/(x**3-1);x || itg;x**3/(x**2+2*x+3);x ||.
In case rational integrands are direct results from substitution, continue evaluating the integrals by use of the partial fractions method. For example, to evaluate \(\int\frac{d}{1+e^x}\), let \(u=1+e^x,du=e^xdx\) and the integral becomes \(\int\frac{du}{u(u-1)}\).
Examples Check the above result by itg;1/(1+exp(x));x ||. Check itg;(1+exp(x))**(1/2);x ||.
Attention Not all functions have antiderivatives. We say F is an antiderivative of f if F'(x) = f(x) for all x in the same domain. The absolute value function f(x) = |x| does not have an antiderivative for all x, because the antiderivatives of |x| differ when x ≥ 0 and when x < 0. Thus, the program won't evaluate integrands involve absolute value functions unless a certain interval is given (refer to definite integrals for absolute value functions).
Examples itg;abs(x);x || itg;abs(x);x;-2;3 || itg;abs(1-x);x || itg;abs(1-x);x;-2;0 || itg;abs(x**2-4);x || itg;abs(x**2-4);x;-2;2 || itg;abs(a*x+b);x || itg;abs(x**2-2*x-3);x;-1;3 || itg;abs(x**2-2*x-3);x;-5;-1 || itg;abs(x**2-2*x-3);x;3;6 ||.
Examples Use the identity \(|x|=\sqrt{x^2}\) or \(|f(x)| = \sqrt{f^2(x)}\) and some assumptions. Check itg;(x**2)**(1/2);x || gives a result for x ≥ 0. There are more such examples by itg;((x-1)**2)**(1/2);x || itg;((x+1)**2)**(1/2);x || itg;((cos(x))**2)**(1/2);x || itg;1/(x**2)**(1/2);x ||.
Antiderivative examples for mixed skills itg;(a+b*x)**(1/2);x || itg;u*(a*u+b)**(1/2);u || itg;exp(a*u)*sin(b*u);u || itg;u*exp(a*u);u || itg;u**3*exp(a*u);u || itg;sin(a*u)*sin(b*u);u || itg;(a**2-y**2)**(1/2);y || itg;y**2/(a**2-y**2)**(1/2);y || itg;1/(a**2-y**2)**(1/2);y || itg;(u**2+a**2)**(1/2);u || itg;w/(a+b*w);w || itg;(tan(t)**2+cot(t)**2)**2;t || itg;1/(x**(1/2)-x);x || itg;1/(x**(1/3)-x);x || itg;1/(x*(x**(1/2)+1));x || itg;x**(2/3)/(x**2+1);x || itg;1/(sin(t)+cos(t));t || itg;sin(t)/(cos(t)-1);t || itg;2/(x**3+2*x**2+3*x);x ||.
Applications of Antiderivatives and Initial Value Problems
Slopes of tangent lines If the slope \(\frac{dy}{dx}=f'(x)\) of the tangent line at a point \((x_0,y_0)\) to a curve \(y=f(x)\) is given, the equation of the curve can be found by evaluating \(y=\int f'(x)dx=f(x)\) and substituting \((x_0,y_0)\) into \(y=f(x)\).
Examples
(1) A curve through point (1, 4) has slope \(2x+3\) at any point, then its equation is \(y=\int (2x+3)dx\)\(=x^2+3x+c\). Since \(x=1,y=4\), which implies \(c=0, y = x^2+3\). Check itg;2*x+3;x || ode;y_1-2*x-3;x ||.
(2) The equation of the curve through (4, 2) and having a slope \(\frac{x}{y}\) of the tangent line at any point \((x,y)\) can be found \(\frac{dy}{dx}=\frac{x}{y}⇒\int xdx=\int ydy⇒\frac{y^2}{2}=\frac{x^2}{2}+c\). Given \(x=4,y=2⇒c=10\), and the equation of the curve is \(y^2+x^2=20\). Check ode;y_1-x/y;x ||.
Initial value problems
Examples
(1) If \(y''=1\), then \(y'=x+c_1, y=\int y'dx=\int(x+c_1)dx=\frac{x^2}{2}+c_1x+c_2\).
(2) If \(y''=\frac{2}{x^2}\) and the equation of tangent line to the curve \(y\) at (1, 2) is 3x - y = 1, then \(y'=\int \frac{2}{x^2}dx=-\frac{2}{x}+c\). Since \(x=1,y'=3⇒-2+c=3⇒c=5\), and \(y=\int(5-\frac{2}{x})dx=5x-2\log(x)+c_1\). Determine \(c_1\) by \(x=1,y=2⇒c_1=-3\), and the equation of the curve is \(y=5x-\log(x)-3\). Check itg;5-2/x;x ||.
Rectilinear motion Example A particle moves along the x-axis with \(a(t)=t^2-\sqrt{t}\) and \(s(0)=0, v_0=5\), then \(v(t)\) can be obtained by itg;t**2-t**(1/2);t || and \(s(t)\) by itg;t**3/3-2*t**(3/2)/3+5;t ||.
Example A driver starts to apply brakes to the car moving at 50 miles per hour with a(t) = -30 ft/s2. How far in feet the car will have traveled before stop? By slv;-30*t+50*5280/3600;t || itg;-30*t+50*5280/3600;t || 5*22/9*(44-22/9)/3 ||.
Example A particle moves in a line with an initial velocity at 15 feet per second, find the acceleration to bring the particle to a dead stop in 30 feet by itg;a*t+15;t || slv;a*(-15/a)**2/2+15*(-15/a)-30;a ||.
Example A particle moves with a constant acceleration 5 m/s² in a line, the time it takes the particle to reach a velocity at 10 m/s from an initial velocity at 4 m/s can be found by slv;5*t+4-10;t || and the distance (in meters) traveled during this time period can be got by 5*(6/5)**2/2+4*(6/5) ||.
2 Definite Integrals
Definition and Properties
To find the area under the curve of a function, first approximate the area by a sum of small rectangles over subintervals, then compute the exact area (the definite integral) as the limit of these approximations. This process is just as finding the slope (derivative) of a tangent line by first approximating the slope of secant lines and then calculating the limit of the approximations.
Definition of definite integral The definite integral of a function \(f(x)\) defined on \([a,b]\) is the limit of the Riemann sums \(\displaystyle\lim_{||P||\to 0}\sum_{i=1}^nf(c_i)δ x_i\equiv \int_a^bf(x)dx\), where \(c_i\) is any point on the \(i\)th subinterval and \(||P||\) the maximum length of all the partitions. If the limit exists, \(f\) is said to be integrable over \([a,b]\).
Properties and rules of of definite integrals Let \(f,g\) are integrable.
Constant integral \(\int_a^bcdx=c(b-a)\) for any constant \(c\).
Constant multiple \(\int_a^bcf(x)dx=c\int_a^bf(x)dx\) for any constant \(c\).
Sum and difference \([a,b],\int_a^b[f(x)\pm g(x)]dx=\int_a^bf(x)dx+\int_a^bg(x)dx\).
Reverse limits of integration \(\int_b^af(x)dx=-\int_a^bf(x)dx\).
Zero width \(\int_a^af(x)dx=0\) when \(f(a)\) is defined.
Adjacent intervals \(\int_a^bf(x)dx+\int_b^cf(x)dx=\int_a^cf(x)dx\) for all \(a,b,c\).
Substitution \(\int_a^bf[g(x)]g'(x)dx=\int_{g(a)}^{g(b)}f(u)du\).
Integration by parts \(\int_a^bf(x)g'(x)dx=f(x)g(x)|_a^b-\int_a^bf'(x)g(x)dx\).
Inequalities of definite integrals Let \(f, g\) are integrable.
(1) If \(m\le f(x)\le M\) for \(x\in[a,b]\), then \(m(b-a)\le \int_a^bf(x)dx\le M(b-a)\).
(2) If \(f(x)\ge 0\) for \(x\in[a,b]\), then \(\int_a^bf(x)dx\ge 0\)
(3) If \(f(x)\le g(x)\) for \(x\in[a,b]\), then \(\int_a^bf(x)dx\le \int_a^bg(x)dx\)
(4) \(|\int_a^bf(x)dx|\le \int_a^b|f(x)|dx\)
Evaluate definite integrals: [itg; f(x); x; a; b], [itg(f(x), x, a, b)]
We use these properties and basic formulas to evaluate definite integrals \(\int_a^bf(x)dx\). The necessary components are "∫; f(x); dx; a; b", so you can type the code pattern "itg; f(x); x; a; b" to get the value immediately, where "f(x)" is the integrand expression, "x" the integration variable, and "a" and "b" the two integration limits. Be aware that the order of integration limits matters. Reversing the order will result in an opposite sign due to the fact \(\int_a^bf(x)dx=-\int_b^af(x)dx\).
Attention Also use "itg(f(x), x, a, b)" for definite integrals, and get the same results as "itg; f(x); x; a; b".
Examples Check above properties itg(c,x,a,b) || itg(c*f(x),x,a,b) || itg(f(x)+g(x),x,a,b)-itg(f(x),x,a,b)-itg(g(x),x,a,b) || itg(f(x),x,a,a) || itg(x,x,a,c)-itg(x,x,a,b)-itg(x,x,b,c) || itg(x**2,x,a,b)+itg(x**2,x,b,a) ||.
Examples
(1) itg;u**2;u;0;2 || itg(u**2,u,0,2) || will give the value 8/3 of \(\int_0^2u^2du\).
(2) Try these examples to see if you can do it by hand. itg;x/(x**2+1);x;2;2 || itg;2;x;-3;5 || itg;cos(x);x;0;pi || itg;sin(y/2);y;0;pi/3 || itg;3*u**2-u**(-1/2)+1;u;1;4 || itg;2/(1+x**3);x;a;a || itg;abs(x-1);x;-1;1 || itg;abs(u-2);u;3;5 || itg;abs(sin(x));x;0;2*pi || itg;cos(x);x;0;2*pi || itg;y**4*sin(y);y;-5;5 || itg;1/x**(1/2)-x;x;1;5 || itg;(x**2-2*x+1)**(1/2);x;1;3 || itg;abs(x);x;0;1 || itg;abs(x);x;-4;-2 || itg;abs(x);x;-3;3 || itg;1/(1+tan(x)**2);x;0;pi/4 || itg;cos(3*x)*cos(x);x;0;pi/6 ||.
Attention Functions may not be integrable in some domains. The function y = 1/x is not integrable on [-1, 1] and itg;1/x;x;-1;1 || gives NaN, which means not a number. Square (or even) root functions or logarithmic functions are not integrable on intervals including negative values; rational functions are not integrable on intervals where their denominators take a value of 0. Trigonometric functions (except sine and cosine) have infinitely many vertical asymptotes and are not integrable on intervals with vertical asymptotes.
Examples Try these examples by itg;x**(1/2);x;-1;0 || itg;log(x);x;-1;0 || itg;tan(x);x;0;pi ||. The example itg;(1-x**2)**(1/2);x;-1;1 || gives the value π/2 of \(\int_{-1}^1\sqrt{1-x^2}dx\), the area of half unit circle. Beyond the interval [-1, 1], the function (unit circle) is not defined, and itg;(1-x**2)**(1/2);x;-2;2 || gives a result of a complex number.
Notice that integration limits are not restricted to numbers. They can be variables, infinity (represented by 'oo' or '-oo'), or functions. In multiple integration, some regions are bounded by curves and/or surfaces, which are represented by functions of one or two variables. Also refer to improper integrals to see what it means for integrals having infinity as their integration limits, or integrands having vertical asymptotes over certain intervals.
Examples itg;pi*(r**2-x**2);x;-r;r || itg;x;x;0;a || itg;a;x;1;3 || itg;(1+t**2)**(1/2);t;0;x || itg;exp(-u**2);u;0;oo || itg;exp(-u**2);u;-oo;oo || itg;1/x;x;1;oo || itg;x**(-2);x;1;oo || itg;x**(-1/2);x;1;oo || itg;x**(-1.5);x;1;oo || itg;exp(-x**2);x;-oo;oo ||.
Definite integrals for absolute value functions To evaluate definite integrals of absolute value functions, divide the integration limits into subintervals on which the signs of integrands can be determined, and then calculate the sum of integrals over all subintervals.
Example \(\int_{-5}^3|2x-3|dx=\int_{-5}^{1.5}(3-2x)dx+\int_{1.5}^3(2x-3)dx=44.5\), or by itg;abs(2*x-3);x;-5;3 ||. Also get the result from the sum of two integrals by itg;3-2*x;x;-5;1.5 || itg;2*x-3;x;1.5;3 ||.
Example \(\int_0^{\frac{\pi}{2}}|\cos(t)-\sin(t)|dt = \int_0^{\frac{\pi}{4}}[\cos(t)-\sin(t)]dt+\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}[\sin(t)-\cos(t)]dt=2\sqrt{2}-2\), or by itg;abs(cos(t)-sin(t));t;0;pi/2 ||. Or by the sum of two integrals itg;cos(t)-sitg(t);t;0;pi/4 || itg;sin(t)-cos(t);t;pi/4;pi/2 ||.
Example In many cases, you don't need to divide the interval into subintervals when using "itg" module. In case no final result is given such as itg;abs(x**2-1);x;0;2 ||, split the interval and sum up the results by itg;x**2-1;x;1;2 || itg;1-x**2;x;0;1 ||.
Example For the identity \(|x+1|=\sqrt{(x+1)^2}=\sqrt{x^2+2x+1}\), first try itg;abs(x+1);x;-2;3 || itg;((x+1)**2)**(1/2);x;-2;3 || itg;(1+2*x+x**2)**(1/2);x;-2;3 ||, and determine the subintervals,e.g., itg(-x-1,x,-2,-1)+itg(x+1,x,-1,3) ||.
Example The half angle formulas \(\sin^2\frac{t}{2}=\frac{1-\cos t}{2}\) and \(\cos^2\frac{t}{2}=\frac{1+\cos t}{2}\) are useful for some functions involve sine and cosine, but itg;(1-cos(t))**(1/2);t;0;2*pi || itg;(1+cos(s))**(1/2);s;0;pi fail to give final results. However, if you write the integrands as \(\sqrt{1-\cos t}=\frac{|\sin\frac{x}{2}|}{\sqrt{2}}\) and \(\sqrt{1+\cos t}=\frac{|\cos\frac{x}{2}|}{\sqrt{2}}\), then itg;abs(sin(t/2))/2**(1/2);t;0;2*pi || itg;abs(cos(t/2))/2**(1/2);t;0;2*pi || give the final results.
Match integrands and integration variables If integrands involve several variables, the variables other than the integration variable will be treated as constants. Be sure to correctly specify the integration variable and its interval for integration.
Examples Check the difference itg;a*x**(-2/3);x;1;5 || itg;a*x**(-2/3);a;1;5 ||.
Geometric reasoning on definite integrals The definite integral \(\int_a^bf(x)dx\) represents the signed area enclosed by \(y=f(x), x=a, x=b\) and the x-axis. So the value of \(\int_{-r}^r\sqrt{r^2-x^2}dx\) is the area of the top circle of radius \(r>0\), which is \(\frac{\pi r^2}{2}\), and \(\int_{-a}^a\frac{b}{a}\sqrt{a^2-x^2}dx\) is the area of the top ellipse \(\frac{x^2}{a^2}+\frac{y^2}{b^2}=1,a>0,b>0\), which is \(\frac{\pi ab}{2}\).
Examples It is hard to evaluate itg;(r**2-x**2)**(1/2);x;-r;r || itg;b*(1-x**2/a**2)**(1/2);x;-a;a || directly. Try itg;(4-x**2)**(1/2);x;-2;2 || itg;2*(1-x**2/9)**(1/2);x;-3;3 ||.
Definite integrals for even and odd functions Suppose \(f\) is continuous on \([-a,a]\). Then \(\int_{-a}^af(x)dx=0\) if \(f\) is odd, and \(\int_{-a}^af(x)=2\int_0^af(x)dx\) if \(f\) is even. These properties are often used to simplify definite integrals.
Examples \(∫_{-1}^1x^2\sin xdx=0,∫_{-1}^1x^3\tan xdx=0,∫_{-1}^1x\sin x^3dx=0\). Check itg;x**2*sin(x);x;-1;1 || itg;x**3*cos(x);x;-1;1 ||. This integral itg;x**2*tan(x);x;-1;1 || is hard to evaluate, but nit;x**2*tan(x);x;-1;1 || gives 0.
Numerical Approximation for Definite Integrals
Numerical integration: [nit; f(x); x; a; b; n], [nit(f(x), x, a, b, n)], [nit; f(x); x; a; b]Numerical integration is used to approximate the definite integrals \(∫_a^bf(x)dx\) where there are no explicit antiderivatives. The "nit" (numerical integration) module implements Simpson's rule, trapezoidal rule, midpoint rule along with the left and right endpoints approximations for definite integrals. These methods use Riemann sums to approximate definite integrals by dividing an interval [a, b] into n equal parts of length Δx = (b -a )/n. Let Ln, Rn, Mn be a Riemann sum based on the left endpoints, right endpoints and midpoints, respectively. Then the trapezoidal rule is Tn = (Ln + Rn)/2 and Simpson's rule is S2n = (Tn + 2Mn)/3.
The "nit" module can help approximate \(∫_a^bf(x)dx\) by "nit; f(x); x; a; b; n", where n is the number of partitions. Use "nit(f(x), x, a, b, n)" only for Simpson's rule. If "n" is not specified, numerical integration by quadrature points is carried out with the form "nit;f(x);x;a;b".
Approximation errors In general, the error bound of Simpson's approximation is much smaller than the trapezoidal and midpoint approximations. As Δx approaches 0, the error approaches 0 as fast as the fourth power of Δx. This means if a function f is a polynomial of degree less than 4 (linear, quadratic, cubic functions), there is no error in approximating integrals of f over any interval by Simpson's rule.
Examples nit;x+1;x;2;5;20 || itg;x;x;2;5 || nit;x**2+2*x-4;x;0;3;20 || itg;x**2+2*x-4;x;0;3 || nit;x**3-2*x**2+x/6-7;x;2;6;30 || itg;x**3-2*x**2+x/6-7;x;2;6 || nit;5*x**4-4*x**3;x;0;3;20 || itg;5*x**4-4*x**3;x;0;3 || nit((x+x**2)**(1/3),x,0,2,20) || nit;x+1;x;2;5 || nit;x**2+2*x-4;x;0;3 || nit;x**3-2*x**2+x/6-7;x;2;6 || nit;5*x**4-4*x**3;x;0;3 ||.
Examples It is difficult to integrate functions like \(\cos x^2, e^{-x^3},\sqrt{1+x^3},\cdots\). Check nit;cos(x**2);x;0;3;20 || nit;exp(-x**3);x;0;2;20 || nit;(1+x**3);x;-1;2;20 || nit(sin(x**2),x,0,1,20) || nit((1+x**2)**(1/2),x,0,2, 20) || nit;cos(x**2);x;0;3 || nit;exp(-x**3);x;0;2 || nit;(1+x**3);x;-1;2 || nit;sin(x**2);x;0;1 || nit;(1+x**2)**(1/2);x;0;2 ||.
Fundamental theorem for calculus
Cumulative area functions Assume \(f\) is integrable on a finite interval \(I\) and \(a∈I\). Then \(F(x)=\int_a^xf(t)dt\) is called a cumulative area function. As a result, \(F(a)=0, F'(x)=f(x)\), and \(\int_x^af(t)dt=-\int_a^xf(t)dt=-F(x)\) by interchanging the integration limits.
Note that \(F\) is a new function constructed by a definite integral, or more specifically, \(F\) is an antiderivative of \(f\) constructed by its definite integral, and that \(F\) may or may not have an explicit formula. But \(F\) can be computed numerically and graphed by computer programs.
Since \(f(x)=F'(x)\), the size of \(f(x)\) tells how quickly the area \(F(x)\) changes. The greater of the value of \(f(x)\), the faster \(F(x)\) changes at \(x\). The sign of \(f(x)\) determines whether \(F(x)\) is increasing or decreasing. If \(f(x)> 0\), then \(F(x)\) is increasing because as \(x\) moves from left to right, positive area is added up. When \(f(x) < 0\), \(F(x)\) is decreasing because negative area is added up. When \(f(x)\) change sign from positive to negative, then \(F(x)\) has a local minimum at \(x\) for which \(f(x)=0\) by the first derivative test, and when \(f(x)\) changes sign from negative to positive, \(F(x)\) has a local maximum at \(x\) for which \(f(x)=0\).
Fundamental theorem of calculus (FTC) We use FTC-I to create new functions by definite integrals, and use FTC-II to evaluate definite integrals by first finding an antiderivative and substituting the integration limits into the antiderivative.
FTC-I If \(f\) is continuous on \([a,b]\), then \(F(x)=\int_a^xf(t)dt\) is continuous on \([a,b], F(a)=0\), and \(F'(x)=\frac{d}{dx}\int_a^xf(t)dt=f(x)\) for \(x\in(a,b)\).
FTC-II If \(f\) is continuous on \([a,b]\) and \(F'(x)=f(x)\), then \(\int_a^bf(x)dx=F(b)-F(a)\).
Examples Verify FTC-I.
(1) Create a function F(x) for s > 0 by itg;cos(s*t);t;1;x ||, then check F(1) = 0 by (sin(s*1)-sin(s))/s ||,
and F'(x) = cos(sx) by dif;(sin(s*x)-sin(s))/s;x ||. Put it together by dif(itg(cos(s*t),t,1,x),x) ||, and you get cos(sx) back.
(2) Create a
function G(x) by itg;t*log(t);t;2;x ||. Check G'(x) = xln(x) by dif;x**2*log(x)/2-x**2/4-log(4)+1;x ||. Check G(2) = 0 by 2**2*log(2)/2-2**2/4-log(4)+1 ||.
Put it together dif(itg(t*log(t),t,2,x),x) || for the result xln(x).
Examples
(1) The logarithmic function is defined by \(\ln x=\int_1^x\frac{1}{t}dt\) for all \(t > 0\). Check this definition by
itg;1/t;t;1;x ||, and understand the geometric meaning of ln(x) for x > 1 by itg;1/t;t;1;1.6 || itg;1/t;t;1;2 || itg;1/t;t;1;e || itg;1/t;t;1;5 ||
itg;1/t;t;1;8 ||. Check its derivative dif;log(x);x || or dif(itg(1/t,t,1,x),x) ||
(2) itg;sin(t)**2*cos(t);t;0;x || itg;t**(-3/2);t;a;x ||.
Examples Find the derivatives of area functions by definition. The derivative \(\frac{d}{dx}\int_a^x\sqrt{3t^2+4}dt=\sqrt{3x^2+4}, D_y\int_0^ye^{t^2}dt=e^{y^2},D_z\int_{\pi}^z\cos s^2ds=\cos z^2\), and \(D_w\int_{-1}^w\ln(2t^2+3)dt\) \(=\ln(2w^2+3)\) by FTC-I. Verify these results by dif(itg((3*t**2+4)**(1/2),t,a,x),x) || dif(itg(exp(t**2),t,0,y),y) || dif(itg(cos(s**2),s,pi,z),z) ||.
If \(A(x)=\int_a^xf(t)dt,A[h(x)]=\int_a^{h(x)}f(t)dt\), and its derivative \(\frac{d}{dx}\int_a^{h(x)}f(t)dt=f[h(x)]h'(x)\) by the chain rule. In general, the derivative \(D_x\int_{u(x)}^{h(x)}f(t)dt=D_x[\int_{u(x)}^af(t)dt+\int_a^{h(x)}f(t)dt]=f[h(x)]h'(x)-f[u(x)]u'(x)\).
Attention Verify the results for derivatives of area functions by
(1) dif(itg(f(t),t,a,h(x)),x) || for the first result.
(2) dif(itg(f(t),t,u(x),h(x)),x) || for the general result
Examples
(1) \(\frac{d}{dx}\int_b^{-x}f(t)dt=-f(-x)\), and \(\frac{d}{dx}\int_{-x}^xf(t)dt=\frac{d}{dx}[\int_{-x}^af(t)dt+
\int_a^xf(t)dt]\)\(=f(x)+f(-x)\). Verify the results by dif(itg(f(t),t,b,-x),x) || dif(itg(f(t),t,-x,x),x) ||.
(2) The derivative \(D_x\int_a^{2\sqrt{x}}
\sqrt{t^2+3}dt= \frac{\sqrt{4x+3}}{\sqrt{x}}\), and \(D_u\int_8^{1/u}\frac{t}{1+t^3}dt=\frac{1/u}{1+1/u^3}\frac{-1}{u^2}\)\(=\frac{-1}{1+u^3}\).
Verify the results by dif(itg((t**2+3)**(1/2),t,a,2*x**(1/2)),x) || dif(itg(t/(1+t**3),t,8,1/u),u) ||.
(3) Get the derivative \(D_x\int_{-2x}^{3x^2}
\sqrt{4+t^2}dt\) by dif(itg((4+t**2)**(1/2),t,-2*x,3*x**2),x) ||.
Examples
(1) If \(F(x)=\int_1^xf(t)dt=x-\frac{1}{x}, f(x)=F'(x)=1+\frac{1}{x^2}\), and verify it by \(∫_1^xF'(x)dx=\)\(\int_1^x(1+\frac{1}{t^2})dt=
(t-\frac{1}{t})|_1^x=x-\frac{1}{x}\). Check dif(x-1/x,x) || itg(dif(t-1/t,t),t,1,x) || itg(1+1/t**2,t,1,x) ||.
(2) If \(\int_0^xf(x)=\cos(x)+e^x\),
then \(f(x)=e^x-\sin(x)\), and verify the result by \(\int_0^x[e^t-\sin(t)]dt=(e^t+\cos(t))|_0^x=e^x+\cos(x)-2\), which differs by a constant.
|| itg(dif(cos(t)+exp(t),t),t,0,x) ||.
The limit \(\lim\limits_{h\to0}\int_a^{a+h}f(t)dt=f(a)\). To see why, let \(g(x)=\int_b^xf(t)dt\). Then \(\frac{1}{h}\int_a^{a+h}f(t)dt=\frac{g(a+h)-g(a)}{h}\) and \(\lim\limits_{h\to 0}\frac{g(a+h)-g(a)}{h}=g'(a)=f(a)\).
Examples Let \(g(x)=∫_b^xe^{t^2-1}dt\). Find the slope of \(g(x)\) at \(x=1\). The slope \(g'(1)\) is 1 by \(\lim\limits_{h\to 0}\frac{1}{h} \int_1^{1+h}e^{t^2-1}dt\). Get the derivative \(g'(x)=e^{x^1-1}⇒g'(1)=1\) by dif(itg(exp(t**2-1),t,b,x),x) ||. Verify it by lim(itg(exp(t**2-1),t,1,1+h)/h,h,0) ||. The slope at \(x=a\) is by lim(itg(exp(t**2-1),t,a,a+h)/h,h,0) ||.
Combination of derivatives and integrals Using "dif" and "itg" modules we can verify the general formula \(\frac{d}{dx}∫_a^bf(x,y)dy=∫_a^b\frac{∂f(x,y)}{∂x}dy\) by showing the expression dif(itg(f(x,y),y,a,b),x)-itg(dif(f(x,y),x),y,a,b) = 0.
Examples Verify the above general formula with some specific functions.
(1) If f(x, y) = xy, then dif(itg(x*y,y,a,b),x)-itg(dif(x*y,x),y,a,b) = 0.
(2) If f(x, y) = 2sin(3x+4y), then dif(itg(2*sin(3*x+4*y),y,0,1),x)-itg(dif(2*sin(3*x+4*y),x),y,0,1) = 0
(3) If f(x, y) = ex+2y, then dif(itg(exp(x+2*y),y,-1,1),x)-itg(dif(exp(x+2*y),x),y,-1,1) = 0.
Integration by substitution \(\int_a^bf[g(x)]g'(x)dx=\int_{g(a)}^{g(b)}f(u)du\) by letting \(u=g(x)\). Substitution for definite integrals not only changes integrands and integration variables, but also changes the limits of integration. || itg(f(g(x))*dif(g(x),x),x,a,b) ||.
The above formula is also called change of variables for definite integrals. If \(F(x)\) is an antiderivative of \(f(x), F'(g(x))=f(g(x))g'(x)\), which implies \(F(g(x))\) is an antiderivative of \(f(g(x))g'(x)\). By FTC-I and FTC-II, \(∫_a^bf(g(x))g'(x)dx=F(g(b))-F(g(a))\) or \(∫_{g(a)}^{g(b)}f(u)du=F(g(b))-F(g(a))\).
The integral \(\int_a^bf(x-k)dx=\int_{a-k}^{b-k}f(x)dx\) by substituting \(u=x-k,du=dx\), and \(x=a⇒u=a-k, x=b\)\(⇒u=b-k\). Similarly, \(\int_a^bf(x)dx=\int_{a+k}^{b+k}f(x-k)dx=\int_0^{b-a}f(x+a)dx\).
Examples Evaluate \(∫_0^{\sqrt{π/2}}\sqrt{\sin x^2}(\sin x^2)'dx\) by itg(sin(x**2)**(1/2)*dif(sin(x**2),x),x,0,(pi/2)**(1/2)) ||, which is a hard way. By substitution, it becomes \(∫_0^1\sqrt{u}du=\frac{2}{3}\) by itg(u**(1/2),u,0,1) ||.
Examples || itg;y**2*(y+5)**(1/2);y;-3;2 || itg;t**3*(t**2-4)**(1/2);t;2;5 || itg;abs(a-3);a;1;5 || itg;u**2*(2*u+3)**(1/2);u;1;4 || itg;(2*x-x**2)**(1/2);x;0;2 ||.
3 Application of Definite Integrals
Areas between two curves The area enclosed by the curve of \(f(x)≥0\), the x-axis, and between \(x=a\) and \(x=b\) is \(\int_a^bf(x)dx\). The area between \(x=g(y)≥0,y=c, y=d\), and the y-axis is \(\int_c^dg(y)dy\).
Examples Use the "itg" module to evaluate the areas bounded by curves in the plane.
(1) The area bounded by y = 1/x between x = 1 and x = 2 is log(2) by itg;1/x;x;1;2 ||. View the graph by plt;1/x;1;2 ||.
(2) The area x = 3y² from y = 2 to y = 4 is 56 by itg;3*y**2;y;2;4 || pc2;3*y**2;y;2;4 ||.
(3) To find the area between the curve y = x³ - x² - 6x and the x-axis, use plt;x**3-x**2-6*x || to view the two regions (one above and one below the x-axis), use slv;x**3-x**2-6*x;x || to find the intersection at x = -2, x = 0 and x = 3, and evaluate the area (the sum 16/3 + 63/4) by itg;x**3-x**2-6*x;x;-2;0 || itg;-(x**3-x**2-6*x);x;0;3 ||.
(4) To find the area enclosed by y² = 4x² - x³, use imf;4*x**2-x**3-y**2 || to view the graph, use slv;4*x**2-x**3;x || to solve the intersection x = 0 and x = 4, and evaluate the area = 256/15 by itg;2*(4*x**2-x**3)**(1/2);x;0;4 ||.
Areas between top-bottom curves To find areas bounded by two curves between \(f\) (top) and \(g\) (bottom), first solve the points of intersection by use of the "slv" module, and then evaluate them by \(\int_a^b[f(x)-g(x)]dx\) for \(f(x)≥g(x)\).
Areas between left-right curves Areas bound by curves between \(v\) (left) and \(u\) (right) can be evaluated by \(\int_c^d[u(y)-v(y)]dy\) for \(u(y)≥v(y)\).
Examples
(1)To find the area between y = x² and x = y² (left-right curves), solve the intersection x = 0 and x = 1 by slv;x-x**4;x ||, and evaluate the area = 1/3 by itg;x**(1/2)-x**2;x;0;1 ||.
(2) To find the area enclosed between y = x³ and y = -x (bottom-top curves), and under y = 2, solve the intersection at (0, 0) by slv;x**3+x;x ||, and evaluate the area = 5/4 by itg;y**(1/3)+y;y;0;2 ||.
(3) To find the area between y² = x + 4 and y = x - 2 (left-right), get the intersection (0, -2) and (5, 3) slv;(x-2)**2-x-4;x || and evaluate the area = 125/6 by itg;y+2-(y**2-4);y;-2;3 ||.
In general, to find the areas between two curves by \(\int_a^b|f(x)-g(x)|dx\) or \(\int_c^d|u(y)-v(y)|dy\), first sketch their graphs by the "plt" module, solve \(f(x)=g(x)\) or \(u(y)=v(y)\) for points of intersection by "slv", and evaluate the integrals by "itg". If the two curves cross one another over an interval, break the interval up into subintervals based on the points of intersection, evaluate the integral over each subinterval according to which function is greater than the other (or which one is on top or right), and sum up the integrals over all subintervals.
Arc length The length of a smooth curve \(f\) from \(x=a\) to \(x=b\) can be calculated by \(s=\int_a^b\sqrt{1+f'(x)^2}dx\), but the radical expression in the formula usually makes this integral hard to evaluate. The different \(ds=\sqrt{1+f'(x)^2}dx\) is called arc length different.
Examples Use "dif" to find the derivative \(f'(x)\), and then use "itg" to evaluate the definite integral.
(1) The length of \(y=x^{\frac{2}{3}}\) from x = 0 to x = 1 by dif;x**(2/3);x || itg;(1+4*x**(-2/3)/9)**(1/2);x;0;1 ||.
(2) The length of y = 2x - 5 from x = 1 to 3 by itg;(1+4)**(1/2);x;1;3 ||.
(3) To find the length of the curve \(9y^2=4(x-1)^3\) for \(y≥0\) and \(x\) from 1 to 4, graph by imf;4*(x-1)**3-9*y**2 ||, solve for \(y=\frac{2}{3}(x-1)^{\frac{3}{2}}⇒y'=\sqrt{x-1}\), and the length is 7.5 by itg;x;x;1;4 ||.
Example For functions implicitly defined in an equation such as x² + y² = 1, use idf;x**2+y**2-1;x;y || to get y' = -x/y ⇒ (y')² = x²/(1-x²), and use itg;1/(1-x**2)**(1/2);x;-1;1 to obtain the length = π.
Example If the resulting derivative is in the form y' = f(x, y), express y' or (y')² in terms of x before applying the arc length formula. To find the length of an implicit curve \(x^{\frac{2}{3}}+y^{\frac{2}{3}}=9\) from x = 0 to 8, use idf;x**(2/3)+y**(2/3)-9;x;y || to get \(y'=-\sqrt[3]{\frac{y}{x}}⇒(y')^2=(\frac{y}{x})^{\frac{2}{3}}=9x^{-\frac{2}{3}}-1\), and use itg;3*x**(-1/3);x;0;8 || to get the length = 18.
Examples Approximate arc length by numerical integration using the "nit" module.
(1) Find length of y = x² for x from 0 to
2 by nit;(1+4*x**2)**(1/2);x;0;2;30 ||.
(2) The arc length of y = sin(x) for 0 ≤ x ≤ π by nit;(1+cos(x)**2)**(1/2);x;0;pi;30 ||.
Rectilinear motion The distance traveled by a particle moving in a straight line is calculated by \(\int_a^b|v(t)|dt\).
Examples The distance of a particle moving along a straight line with velocity \(t^2-4\) m/s travels 16 meters within the first 4 seconds by \(\int_0^4(t^2-4)dt\) meters by itg;4-t**2;t;0;2 || itg;t**2-4;t;2;4 ||.
Improper integrals We extend definite integrals to integration over infinite intervals, and also allow the integrands to have vertical asymptotes within integration limits. This type of integrals is called improper integrals. Assume \(f\) is continuous on \([a,\infty),\int_a^{\infty}f(x)dx\)\(=\displaystyle\lim_{b\to\infty}\int_a^bf(x)dx\) if the limit exists, and \(\int_{-\infty}^bf(x)dx=\displaystyle \lim_{a\to -\infty}\int_a^bf(x)dx\) if \(f\) is continuous on \((-\infty,b]\).
Similarly, if \(f\) is continuous on \([a,b)\), \(\int_a^bf(x)dx=\displaystyle\lim_{R\to b^-}\int_a^Rf(x)dx\), and \(\int_a^bf(x)dx=\displaystyle\lim_{R\to a^+}\int_R^bf(x)dx\) if \(f\) is continuous on \((a,b]\). An improper integral converges if the limit exists. Otherwise it diverges.
Examples The "itg" module helps evaluate improper integrals.
(1) The integrals itg;1/x;x;1;oo || itg;1/x;x;0;1 || diverges; the integrals itg;log(x);x;0;1 || itg;exp(-x);x;0;oo || converges.
(2) Verify p-integral \(\int_a^{\infty}\frac{1}{x^p}dx\) converges on for \(p > 1,a>0\) and diverges for \(p\le 1\) by itg;1/x**2;x;1/3;oo || itg;1/x**(1/2);x;1;oo || itg;1/x**(-3);x;2;oo || itg;1/(x+5)**4;x;2/5;oo ||.
(3) Verify \(\int_0^a\frac{1}{x^p}dx\) converges for \(p< 1\) and diverges for \(p≥1\) by itg;1/x**(2/3);x;0;1 || itg;1/x**4;x;0;2 || itg;1/x**(1/2);x;0;1/2 || itg;1/(1-x)**2;x;0;3 || itg;1/(1-x)**(3/5);x;0;1 || itg;log(x)/x**2;x;1;oo || itg;log(x)/x**(1/2);x;1;oo || itg;log(x)/x;x;1;oo || itg;log(x)/x**5;x;1;oo ||.
(4) Verify \(\frac{1}{(\ln x)^p}\) diverges on \([e,\infty]\) for all \(p\) by itg;1/log(x);x;e;oo || itg;1/log(x)**2;x;e;oo || itg;1/log(x)**(1/3);x;e;oo ||.
(5) Verify the gamma function \(\Gamma(n+1)=\int_0^{\infty}x^{n-1}e^{-x}dx=n!\) converges for \(n > 0\) by itg;exp(-x);x;0;oo || itg;x**(-1/2)*exp(-x);x;0;oo || itg;x**2*exp(-x);x;0;oo || itg;x**5*exp(-x);x;0;oo || itg;x**(10)*exp(-x);x;0;oo ||.
Examples itg;1/x**2;x;0;3 || itg;x**(-1/2);x;0;4 || itg;1/(1-x);x;0;1 || itg;1/x**3;x;1;oo || itg;1/x**(1/3);x;1;oo || itg;1/(x**2+a**2);x;0;oo || itg;t*exp(-2*t);t;0;oo || itg;t*exp(-a*t);t;0;oo || itg;sin(t)*exp(-a*t);t;0;oo || itg;1/(t**2+s**2);t;0;oo || itg;1/(x*log(x)**6);x;e;oo || itg;exp(-x**(1/2));x;0;oo || itg;1/(x-3);x;1;5 || itg;1/(x-3)**(1/3);x;1;5 || itg;1/(x**2-a**2);x;a+1;oo || itg;1/log(x);x;1;e || itg;x/(1+x**4);x;0;oo || itg;1/(1-cos(x));x;0;pi/2 || itg;1/(x**2-2*x-3);x;-3;3 ||.
Volume of revolution
Disk method The volume of a solid generated by revolving the region bounded by the curve \(y=f(x),x=a,x=b\) about the x-axis is \(π\int_a^by^2dx\), and the volume generated by revolving the region bounded by \(x=g(y),y=c,y=d\) about the y-axis is \(π\int_c^dx^2dy\).
Examples
(1) The volume of the ball by revolving the top half circle \(y=\sqrt{r^2-x^2}\) about the x-axis can be obtained by
itg;pi*(r**2-x**2);x;-r;r || itg(pi*(r**2-x**2),x,-r,r) ||.
(2) The volume of the ellipsoid by revolving the top ellipse \(\frac{x^2}{a^2}+\frac{y^2}{b^2}=1\) about the x-axis can be obtained by itg;pi*b**2*(1-x**2/a**2);x;-a;a ||.
(3) The volume of the cone (base radius r and height h) by revolving y = rx/h on [0, h] about the x-axis can be obtained by itg;pi*(r**2*x**2/h**2);x;0;h ||.
(4) The volume of the cylinder by revolving y = r on [0, h] can be obtained by itg;pi*r**2;x;0;h ||. The volume of the region by revolving x = y² on [0, 2] about the y-axis can be obtained by itg;pi*y**4;y;0;2 ||.
(5) The volume of the region by revolving y = 1/x on [1, 4] about the x-axis is 3π/4 by itg;pi/x**2;x;1;4 ||.
(6) The volume of the region by revolving the curve \(y^{\frac{2}{3}}+x^{\frac{2}{3}}=4\) about the x-axis is by itg;pi*(4-x**(2/3))**3;x;0;8 ||.
Examples
(1) The volume of revolving the region enclosed by y = x³ + x and x = 1, y = 0 about the line y = -2 is 407π/105 by itg;pi*((x**3+x+2)**2-2**2);x;0;1 ||, because the outer radius is y + 2 and the inner radius is 2.
(2) If the region is rotated about the line y = 3, then the outer radius is 3 and the inner radius is 3 - y, so volume is 761π/210 by itg;pi*(9-(3-x**3-x)**2);x;0;1 ||.
Washer method The volume of a solid generated by rotating a region enclosed by \(f(x)\) and \(g(x)\) for \(f(x) ≥ g(x)\) around the x-axis is \(π\int_a^b[f^2(x)-g^2(x)]dx\), and the volume generated by revolving the region bounded by \(x=g(y),y=c,y=d\) about the y-axis is \(π\int_c^d[u^2(y)-v^2(y)]dy\).
Examples Use the "slv" module to find the points of intersection, and use "itg" to evaluate the integral.
(1) The volume of revolving the region bounded by y = x and y = x²/4 about the x-axis is 128π/15 by slv;x-x**2/4;x || itg;pi*(x**2-x**4/16);x;0;4 ||, and the volume of revolving the region about the y-axis is 16π/3 by itg;pi*(4*y-y**2);y;0;2 ||.
(2) The volume of revolving the region enclosed by y = x and y = x³/4 about the x-axis is 64π/21 (doubled by symmetry) by slv;x-x**3/4;x || itg;pi*(x**2-x**6/16);x;0;2 ||, and the volume of revolving the region about y-axis is 64π/15 by itg;pi*((4*y)**(2/3)-y**2);y;0;2 ||.
Summary In general, disk or washer method is a method of integrating cross-sectional areas, and the disk method is a special case \(g(x)=0\) of washer method. If the region is rotated around a horizontal line \(y=k\) and if \(k\ne 0\), the value of \(k\) affects the radii of both inner and outer circles, and thus affects computing the volume of the solid.
If \(k\ge f \ge g\), then the outer radius is \(k-f(x)\), the inner radius is \(k-g(x)\), and the volume of the solid of revolution is \(\pi\int_a^b[(k-f(x))^2-(k-g(x))^2]dx\). If \(f \ge g\ge k\), then the outer radius is \(f(x)-k\), the inner radius is \(g(x)-k\), and the volume of the solid of revolution is \(\pi\int_a^b[(f(x)-k)^2-(g(x)-k)^2]dx\).
Suppose the bounded region is revolving about a vertical line \(x=k\) and \(k\ne 0\). If \(k\ge u \ge v\), then the outer radius is \(k-u(y)\), the inner radius is \(k-v(y)\), and the volume of the solid of revolution is \(\pi\int_c^d[(k-u(y))^2-(k-v(y))^2]dy\). If \(u \ge v\ge k\), then the outer radius is \(u(y)-k\), the inner radius is \(v(y)-k\), and the volume of the solid of revolution is \(\pi\int_c^d[(u(y)-k)^2-(v(y)-k)^2]dy\).
Cylindrical shell method The volume of a solid generated by revolving the region bounded by \(y=f(x),x=a\), \(x=b\) about the y-axis is \(2π\int_a^bxydx\), and the volume generated by revolving the region bounded by \(x=g(y)\), \(y=c,y=d\) about the x-axis is \(2π\int_c^dxydy\), assuming \(f\) and \(g\) are continuous.
Examples
(1) The volume of revolving the region bounded by y = x and x = 1 about the y-axis is 2π/3 by itg;2*pi*x**2;x;0;1 ||.
(2)
The volume of revolving the region bounded by xy = 1, x = 1, and x = 3 about y-axis is by itg;2*pi*(x*1/x);x;1;3 ||.
(3) The volume of revolving the region enclosed by y = x + 2 and y = (x - 2)² can be got by slv;x+2-(x-2)**2;x || itg;2*pi*x*((x-2)**2-(x+2));x;5/2-17**(1/2);5/2+17**(1/2) ||.
Slicing method (cross sectional area) The volume of a solid is equal to \(\int_a^bA(x)dx\), where \(A(x)\) is its vertical cross sectional area on \([a,b]\), or the volume of a solid is equal to \(\int_c^dS(y)dy\), where \(S(y)\) is its horizontal cross-sectional area on \([c,d]\). The key to slicing method is to determine cross sectional area by use of similar triangles and other geometric properties.
Examples
(1) A cylinder with base radius r and height h has cross sectional area πr², and the volume is πr²h by itg;pi*r**2;x;0;h ||.
(2) A right circular cone with base radius \(r\) and higher \(h\) has cross section area \(π\frac{r^2x^2}{h^2}\), and the volume is \(\frac{\pi r^2h}{3}\) by itg;pi*r**2*x**2/h**2;x;0;h ||.
(3) A square pyramid with height \(h\) and base side \(b\) has a cross section area \(b^2(\frac{h-x)^2}{h^2})\), and the volume is \(\frac{b^2h}{3}\) by itg;b**2*(h-x)**2/h**2;x;0;h ||.
(4) A ball of radius \(r\) has cross sectional area \(\pi (r^2-x^2)\), and the volume is \(\frac{4\pi r^3}{3}\) by itg;pi*(r**2-x**2);x;-r;r ||.
Examples A solid has a circular base of radius \(r\) centered at the origin.
(1) If the cross section is a semicircle, the area is \(\pi(r^2-x^2)/2\) and the volume is \(\frac{2\pi r^3}{3}\) by itg;pi*(r**2-x**2)/2;x;-r;r ||.
(2) If the cross section is a square, the area is \(4(r^2-x^2)\) and the volume is \(\frac{16r^3}{3}\) by itg;4*(r**2-x**2);x;-r;r ||.
(3) If the cross section is an isosceles right triangle with its hypotenuse on the base, the area is \(\frac{1}{2}(\frac{2\sqrt{r^2-x^2}}{\sqrt{2}})^2\), and the volume is \(\frac{4r^3}{3}\) by itg;r**2-x**2;x;-r;r ||.
Surface areas The surface area of revolving a smooth curve \(f≥0\) on an interval \([a,b]\) about the x-axis is given by \(\int_a^b2\pi f(x)\sqrt{1+[f'(x)]^2}dx\), and the surface area of revolving a smooth curve \(x=g(y)≥0\) on \([c,d]\) about the y-axis is \(\int_c^d2\pi g(y)\sqrt{1+[g'(y)]^2}dy\).
Examples Use the "dif" and "itg" modules to find surface areas of revolution.
(1) The surface area of a ball of radius r is 4πr² by dif;x**2+y**2-r**2;x;y || itg;2*pi*y*(r/y);x;-r;r ||.
(2) The surface area of a right circular cone of base radius r and height h can be obtained by dif;x*r/h;x || itg;2*pi*x*r/h*((r**2+h**2)**(1/2)/h);x;0;h ||.
(3) The surface area of y = x² and 0 ≤ x ≤ 1 rotating around the y-axis can be got by itg;2*pi*y**(1/2)*(4*y+1)**(1/2)/(2*y**(1/2));y;0;1 ||.
(4) The surface are of y = x³ and 0 ≤ x ≤ 8 rotating around the x-axis by itg;2*pi*x**3*(1+9*x**4)**(1/2);x;0;8 ||.
(5) The surface area of rotating \(x^{\frac{2}{3}}+y^{\frac{2}{3}}=4\) in the first quadrant around the x-axis is obtained by slv;x**(2/3)+0**(2/3)-4;x || dif;x**(2/3)+y**(2/3)-4;x;y || itg;2*pi*(4-x**(2/3))**(3/2)*(2/x)**(1/3);x;0;8 ||.
(6) The surface area of revolving \(2\sqrt{5-x}\) for \(0≤x≤5\) about the x-axis is got by itg;2*pi*2*(6-x)**(1/2);x;0;5 ||.
(7) The surface area of rotating y² = 4x for 0 ≤ x ≤2 around the x-axis is obtained by dif;y**2-4*x;x;y || itg;2*pi*(4*x+4)**(1/2);x;0;2 ||.
Mass, moments, and center of mass Suppose a lamina has a mass density \(δ\) and is enclosed by a continuous function \(f\) on \([a,b]\). Then the mass of the lamina can be calculated by \(M=\int_a^bδ(x)f(x)dx\), the moment about the x-axis \(M_x=\frac{1}{2}\int_a^bδ(x)f^2(x)dx\), about the y-axis \(M_y=\int_a^bxδ(x)f(x)dx\), and the center of mass is at \((\frac{M_y}{M},\frac{M_x}{M})\).
In particular, if the mass is uniformly distributed across the lamina (or the lamina has a constant density), set \(δ=1\) to simplify all related computation. In this case, the center of mass does not depend the mass density. It only depends on the geometric shape of a region (the lamina), so it is also called the centroid of the region.
Examples
(1) The centroid of the region enclosed by y = ln(x), x = e, and y = 0 is at ((1 + e²)/4, e/2 - 1) by itg;log(x);x;1;e || itg;x*log(x);x;1;e || itg;log(x)**2/2;x;1;e.
(2) The centroid of region bounded by 1/x, x = 1, x = 4 and y = 0 is (3/ln(4), 3/(8ln(4))) by itg;1/x;x;1;4 || itg;x*(1/x);x;1;4 || itg;1/(2*x**2);x;1;4 ||.
(3) The centroid of the region bounded by y = x² and x = y² is at (9/20, 9/20) by itg;x**(1/2)-x**2;x;0;1 || itg;x*(x**(1/2)-x**2);x;0;1 || itg;x/2-x**4/2;x;0;1 ||.
Mean value theorem for integrals If \(f\) is continuous on \([a,b]\), then there exist \(c\in[a,b]\) such that \(f(c)=\frac{1}{b-a}\int_a^bf(x)dx\), and \(f(c)\) is called the mean value of \(f\) on \([a,b]\).
Examples
(1) The mean value of \(\frac{x}{\sqrt{x+2}}\) on [2, 7] is itg;x/(5*(x+2)**(1/2));x;2;7 ||.
(2) Verify the
mean value theorem for \(x\sqrt{x^2-1}\) on [1, 3] by finding the mean value by itg;x*(x**2-1)**(1/2)/2;x;1;3 || and solve for \(x\) by
slv;x*(x**2-1)**(1/2)-8*2**(1/2)/3;x ||, which is in [1, 3].
(3) Evaluate \(\lim\limits_{x\to a^+}\frac{1}{x-a}∫_a^xe^tdt=e^a\) by
lim(itg(exp(t),t,a,x)/(x-a),x,a,p) ||, which is the average value.
Probability The probability of a continuous random variable \(X\) over a given interval \([a,b]\) can be calculated by \(p(a\le X\le b)=\int_a^bf(x)dx\), where \(f(x)\) is the probability density function satisfying \(f(x)\ge 0\) and \(\int_{-\infty}^{\infty}f(x)dx=1\), and \(0\le p(a\le X\le b)\le 1\). The expectation of \(X\) is defined as \(\mu=\int_{-\infty}^{\infty}xf(x)dx\), and the variance is \(\sigma^2=\int_{-\infty}^{\infty}(x-\mu)^2f(x)dx\), where \(\sigma\) is called standard deviation.
Examples The standard normal density function \(f(x)=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}\) is a bell-shaped curve defined on all real numbers. Verify the density by itg;exp(-x**2/2)/(pi*2)**(1/2);x;-oo;oo ||, the mean of the distribution is 0 by itg;x*exp(-x**2/2)/(pi*2)**(1/2);x;-oo;oo ||, and standard deviation is 1 by itg;x**2*exp(-x**2/2)/(pi*2)**(1/2);x;-oo;oo ||.
Examples In general, the normal (Gaussian) density with mean \(\mu\) and standard deviation \(\sigma\) is \(\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}\). Verify the mean by itg;x*exp(-((x-u)/s)**2/2)/(s*(pi*2)**(1/2));x;-oo;oo ||, and the variance by itg;(x-u)**2*exp(-((x-u)/s)**2/2)/(s*(pi*2)**(1/2));x;-oo;oo ||.
Examples The probability of a normal variable over \([a,b]\) is \(p(a\le x\le b)=\frac{1}{\sigma\sqrt{2\pi}}\int_a^be^{-\frac{1}{2} (\frac{x-u}{\sigma})^2}dx\). But there is no elementary antiderivative for this density function. Let us construct an antiderivative \(\Phi(x)=\frac{1}{\sigma\sqrt{2\pi}}\int e^{-\frac{1}{2} (\frac{x-u}{\sigma})^2}dx\) for the density. Then the probability \(p(a\le x\le b)=\Phi(b)-\Phi(a)\). So we need to compute the probability numerically by "nit" or use other computer programs.
Examples nit;exp(-x**2/2)/(pi*2)**(1/2);x;-4.5;0;40 || nit;exp(-x**2/2)/(pi*2)**(1/2);x;0;2;40 || nit;exp(-x**2/2)/(pi*2)**(1/2);x;-2;0;40 || nit;exp(-(x/1.2)**2/2)/(1.2*(pi*2)**(1/2));x;-1;1;40 || nit;exp(-x**2/2)/(pi*2)**(1/2);x;-2;0;40 ||.
Examples To compute the probability for a general normal distribution with \(\mu\) and standard deviation \(\sigma\), we substitute \(z=\frac{x-\mu}{\sigma}, dz=\frac{dx}{\sigma}\), and \(p(a\le x\le b)=p(\frac{a-\mu}{\sigma}≤z≤\frac{b-\mu}{\sigma})= \Phi(\frac{b-\mu}{\sigma})-\Phi(\frac{a-\mu}{\sigma})\). Check examples by nit;exp(-x**2/2)/(pi*2)**(1/2);x;-1/1.2;1/1.2;40 || nit;exp(-x**2/2)/(pi*2)**(1/2);x;(-1-0.3)/1.2;(1-0.3)/1.2;40 ||.
Examples The exponential density function \(ke^{-kt}\) for \(t≥0\) and \(k\) a positive constant is often used to model waiting time or equipment failure time. Verify the density by itg;k*exp(-k*t);t;0;oo ||, calculate the mean 1/k by itg;t*k*exp(-k*t);t;0;oo ||, and the variance by itg;(t-1/k)**2*k*exp(-k*t);t;0;oo ||.
Work The work done by a variable force \(F\) from \(x=a\) to \(x=b\) along a straight line is \(\int_a^bF(x)dx\). The work required to stretch (or compress) a spring \(x\) units from its natural length is \(\int_0^xF(t)dt=\int_0^xktdt=\frac{1}{2}kx^2\) according to Hooke's law, where \(k > 0\) is a force constant.
Examples Work done by a variable force F(x) = 2x + 1 along a line from x = 2 to x = 7 is itg;(2*x+1);x;2;7 ||.
Part II Multiple Integration
Table of Contents: Part II
Back to Part I: Integration for Single Variable Functions
1 Double and Triple Integrals
Double integrals can be used to calculate volumes of solids and areas of general bounded (plane) regions. If \(f\) is continuous on a closed and bounded domain \(D\), then \(\iint_Df(x,y)dA\) represents the signed volume between the surface of \(f\) and the region \(D\) on the xy-plane. In particular, \(\iint_D1dA\) = area(\(D\)) and \(\iint_DcdA\) = \(c\)·area(\(D\)).
For a simple region (rectangle) \(D: a≤x≤b,c≤y≤d,\iint_Df(x,y)dA=\int_a^b\int_c^df(x,y)dydx\), which can be evaluated in any order as an iterated integral by the fundamental theorem of calculus. In case the domain \(D\) is bounded by curves (top and bottom) of \(a≤x≤b, y_1(x)≤y≤y_2(x)\), \(\iint_Df(x,y)dA=\int_a^b\int_{y_1(x)}^{y_2(x)}f(x,y)dydx\), which is called integration along vertical lines throughout the domain.
Similarly, \(\iint_Df(x,y)dA=\int_c^d\int_{x_1(y)}^{x_2(y)}f(x,y)dxdy\) is integrated along horizontal lines. Keep in mind that the order matters for integration over complicated curved domains. The integration limits of inner integrals may involve functions of one variable, and the limits of outer integrals must be constants. To evaluate double integrals, need to set up the bounds for the iterated integrals by graphing the region and taking slices.
Divide the region \(D\) in small pieces with area \(ΔA\), the volume is approximated by \(Σf(x_i,y_i)ΔA_i\), and the limit as \(ΔA→0\) gives the integral \(\iint_Df(x,y)dA\). Note that \(dA=dxdy\), the limit of \(ΔA=ΔxΔy\) for small rectangles.
Evaluate double integrals There are at least 8 necessary items "itg; f(x, y); x; a; b; y; c; d" for evaluating a double integral, because two integration variables "x" and "y" and two limits are involved, with each having its own integration limits. For complicated domains, integration limits of the inner integrals can be functions. Use "nit; f(x, y); x; a; b; y; c; d" for numerical integration.
Also use function call "itg(f(x, y), x, a, b, y, c, d)" for evaluating double integrals, and you get the same results as those from "itg; f(x, y); x; a; b; y; c; d".
Examples For double integrals over a domain with constant integration limits, the order of integration does not matter.
(1) \(\int_0^1\int_{-2}^4(x^2+2y)dydx=14\) by itg;x**2+2*y;x;0;1;y;-2;4 || itg;x**2+2*y;y;-2;4;x;0;1 || nit;x**2+2*y;x;0;1;y;-2;4 || nit;x**2+2*y;y;-2;4;x;0;1 || give the same result.
(2) itg;x+y**2;x;0;2;y;-1;1 || itg;x+y**2;y;-1;1;x;0;2 || itg;sin(x)*cos(y);x;0;pi/2;y;-pi/2;pi/2 || itg;sin(x)*cos(y);y;-pi/2;pi/2;x;0;pi/2 || itg;1;x;0;1;y;-2;3 || itg;x/(x+y)**2;x;0;1;y;1;3 || itg;x*exp(y);x;-1;3;y;0;2 || itg;x*sin(y);x;1;4;y;0;pi || itg;exp(x+y);x;0;log(2);y;0;log(3) || nit;sin(x)*cos(y);x;0;pi/2;y;-pi/2;pi/2 || nit;sin(x)*cos(y);y;-pi/2;pi/2;x;0;pi/2 || nit;1;x;0;1;y;-2;3 || nit;x/(x+y)**2;x;0;1;y;1;3 || nit;x*exp(y);x;-1;3;y;0;2 || nit;x*sin(y);x;1;4;y;0;pi || nit;exp(x+y);x;0;log(2);y;0;log(3) ||.
Examples In particular, if \(f(x, y) = g(x)h(y)\), then \(\int_a^b\int_c^d f(x,y)dxdy=(\int_a^bg(x)dx)\int_c^dh(y)dy\). Check
(1) \(∫_1^e∫_0^1 x\ln(y)dxdy=(∫_0^1xdx)(∫_1^e\ln(y)dy)\) by itg;x*log(y);x;0;1;y;1;e || itg(x,x,0,1)*itg(log(y),y,1,e) || itg(x*log(y),x,0,1,y,1,e)-itg(x,x,0,1)*itg(log(y),y,1,e) ||.
(2) \(∫_0^1∫_0^1 xye^{-x^2-y^2}dxdy=(∫_0^1xe^{-x^2}dx)(∫_0^1ye^{-y^2}dy)\) by itg;x*y*exp(-x**2-y**2);x;0;1;y;0;1 || itg(x*exp(-x**2),x,0,1)*itg(y*exp(-y**2),y,0,1) ||.
Attention Not all functions are integrable. The integrands in double integrals are assumed to be continuous on the given domains. The result from itg;1/(x+y);x;-2;2;y;-2;2 || is not a real number, because the integrand is not continuous over the rectangle domain.
Attention If a double integral involves a domain whose boundaries are simple closed curves, express the integration limits of the inner integral as a function of variables of the outer integral. In this case, the integration order matters, and the integration limits of the outer integral must be constants. Interchanging order of integration will result in an incorrect result.
Examples itg;x*y;y;x;1+x;x;1;4 || itg;x*y**2;y;0;1+x**2;x;0;2 || itg;x*exp(y);x;-y;y+1;y;0;1 || itg;x*sin(y);x;0;y;y;0;pi || itg;2*x+3*y;x;1/y;y**2;y;1;5 || itg;x**3+y;y;x**2;x;x;0;1 || itg;r**2*cos(t);r;0;sin(t);t;0;pi/2 || itg;x*y;y;0;1-x**2;x;0;1 || itg;exp(-x);x;y/3;2;y;0;1 || itg;3*x;y;2-x;x**2;x;-2;1 ||.
Examples Graph the domains for double integrals using "plt" module. The domain involves in \(\int_{-2}^1\int_{2-x}^{x^2}3xdydx\) by itg;3*x;y;2-x;x**2;x;-2;1 || can be graphed by plt;2-x;x**2;itv=(-2,1) ||.
Examples
(1) Find the area of a circle of radius r = 2 by itg;2;y;0;(4-x**2)**(1/2);x;-2;2 ||.
(2) Find the area of an ellipse of axes a = 3, b = 2 by itg;2;y;0;2*(9-x**2)**(1/2)/3;x;-3;3 ||.
(3) Find the area enclosed by y = x² and x = y² by itg;1;y;x**2;x**(1/2);x;0;1 ||.
Examples Show the area of the ellipse x2/16 + y2/9 = 1 equals to 12π by itg;2;y;0;3*(1-x**2/16)**(1/2);x;-4;4 ||. Note that it is more computationally efficient to evaluate plane areas by the line integrals by Green's theorem \(\int_cxdy=-\int_cydx=\frac{1}{2}\int_cxdy-ydx\). Refer to the section line and surface integrals for more information. In this case, check the results lit;x*j;4*cos(t)*i+3*sin(t)*j;t;0;2*pi;x;y || lit;-y*i;4*cos(t)*i+3*sin(t)*j;t;0;2*pi;x;y || lit;(x*j-y*i)/2;4*cos(t)*i +3*sin(t)*j;t;0;2*pi;x;y ||.
Examples Find the volume of a wedge cut from a cylinder 4x2 + y2 = 36 by z = 0 and z = 2y. The domain in the xy-plane is an ellipse and by symmetry, the volume can be obtained by itg;2*(2*y);y;0;(36-4*x**2)**(1/2);x;-3;3 ||.
Double integrals in polar coordinates: [itg; f(r,θ); r; r0; r1; θ; θ0; θ1], [itg(f(r,θ), r, r0, r1, θ, θ0, θ1)]Polar and rectangular coordinates are related by the equations \(x=r\cos\theta,y=r\sinθ\) and \(r^2=x^2+y^2\). Double integrals sometimes are easier to evaluate by use of polar coordinates (for regions involving circles), a special transformation (change of variables) that transforms a point \((r,θ)\) in the \(rθ\)-domain to a point in the xy-plane \((x,y)=(r\cosθ,r\sinθ)\). The formula is \(\iint_Df(x,y)dA=\int_{θ_1}^{θ_2}\int_{r_1(θ)}^{r_2(θ)}f(r\cosθ,r\sinθ)rdrdθ\). Notice that the limits of inner integrals are usually polar curves represented by polar functions r(θ), and the outer limits are constant angles measured by radians.
The area element is \(ΔA≈(rΔθ)Δr\), and take \(Δθ,Δr→0\) for \(dA=rdrdθ\).
Examples It is difficult to evaluate \(\int_0^2\int_0^{\sqrt{4-x^2}}\sqrt{x^2+y^2}dydx\) directly by itg;(x**2+y**2)**(1/2);y;0;(4-x**2)**(1/2);x;0;2 ||. Since the domain is a quarter circle, get the result using polar coordinates by itg;r**2;r;0;2;t;0;pi/2 ||, which is much simpler.
Examples
(1) To evaluate \(\int_0^1\int_x^{\sqrt{1-x^2}}(x^2+y^2)^{-\frac{1}{2}}dydx\) by use of polar coordinates by itg;1;r;0;1;t;pi/4;pi/2 || is much easier than does it directly.
(2) Evaluate \(\int_{-2}^2\int_0^{\sqrt{4-y^2}}e^{-x^2-y^2}dxdy\) by itg;2*r*exp(-r**2);r;0;2;t;0;pi/2 || by symmetry and polar coordinates.
(3) Show that the area of a circle of radius \(a\) is \(\pi a^2\) by itg;r;r;0;a;t;0;2*pi ||.
(4) Show the volume of a sphere of radius \(a\) is \(\frac{4}{3}\pi a^3\) by itg;2*(a**2-r**2)**(1/2)*r;r;0;a;t;0;2*pi || by symmetry.
(5) Show the volume of a cone of base radius \(a\) and height \(h\) is \(\frac{1}{3}\pi a^2h\) by itg;r*h*(a-r)/a;r;0;a;t;0;2*pi ||.
(6) Show the volume of a cylinder of base radius \(a\) and height \(h\) is \(\pi a^2h\) by itg;r*h;r;0;a;t;0;2*pi ||.
Examples Find the volume of the circular hyperboloid \(x^2+y^2=z^2+1\) between \(z=0\) and \(z=2\) by the result from itg;r*(r**2-1)**(1/2);r;1;5**(1/2);t;0;2*pi ||, given that the domain is a ring between 1 and \(\sqrt{5}\).
Triple integrals: [itg; f(x, y, z); x; a; b; y; c; d; z; u; v], [itg(f(x, y, z), x, a, b, y, c, d, z, u, v)]If \(f(x,y,z)\) is continuous on a bounded solid region \(W\) in space, then \(\iiint_Wf(x,y,z)dV\) represents a triple integral, and needs to be evaluated iteratively. The simple case of a solid region is a box \(B\) defined by boundaries such as \(a≤x≤b,c≤y≤d,p≤z≤q\) for some constants, where \(\iiint_Bf(x,y,z)dV=\int_a^b\int_c^d\int_p^qf(x,y,z)dzdydx\), and it can be integrated iteratively in any order.
If a solid region \(W\) is bounded between two surfaces \(z_1(x,y)\) and \(z_2(x,y)\) over a domain \(D\) in the xy-plane, then \(\iiint_Wf(x,y,z)dV=\iint_D\int_{z_1(x,y)}^{z_2(x,y)}f(x,y,z)dzdA\). In particular, the volume of the solid and bounded region \(W\) is \(\iiint_W1dV=\iint_D[z_2(x,y)-z_1(x,y)]dA\) = volume(\(W\)).
It is usually difficult is to express the integration limits of triple integrals for the domain \(D\) in the xy-plane. In general, we can think of \(D\) as the projection of the intersection between the two boundary surfaces \(z_1(x,y)\) and \(z_2(x,y)\) of the solid region \(W\) onto the xy-plane.
If the domain \(D\) is a rectangle or enclosed by curves \(a≤x≤b, y_1(x)≤y≤y_2(x)\), then the triple integral is \(\iint_D\int_{z_1(x,y)}^{z_2(x,y)}f(x,y,z)dzdA\)\(=\int_a^b\int_{y_1(x)}^{y_2(x)}\int_{z_1(x,y)}^{z_2(x,y)}f(x,y,z)dzdydx\). If \(D\) is enclosed by left-right curves \(c≤y≤d, x_1(y)≤x≤x_2(y)\), then \(\iint_D\int_{z_1(x,y)}^{z_2(x,y)}f(x,y,z)dzdA\)\(=\int_c^d\int_{x_1(y)}^{x_2(y)}\int_{z_1(x,y)}^{z_2(x,y)}f(x,y,z)dzdxdy\). It is important to keep the order of integration as it is in the above formulas. The innermost integration limits are two surfaces involving two variables, the middle limits are two curves involving one variable, and the outermost limits are constants.
In a similar fashion, we can regard the domain \(D\) as the projection of the intersection between two surfaces of \(W\) onto the xz-plane or yz-plane. If \(W\) is between two surfaces \(y_1(x,z)\) and \(y_2(x,z)\) lying over the domain \(D\) in the xz-plane, \(\iiint_Wf(x,y,z)dV=\iint_D\int_{y_1(x,z)}^{y_2(x,z)}f(x,y,z)dydA\). If \(W\) is between two surfaces \(x_1(y,z)\) and \(x_2(y,z)\) lying over the domain \(D\) in the yz-plane, \(\iiint_Wf(x,y,z)dV=\iint_D\int_{x_1(y,z)}^{x_2(y,z)}f(x,y,z)dxdA\).
In summary, to set up the bounds for triple integrals, first fix (x, y) and find the lower and upper bounds for z, then find the projection (shadow) of the region W on the xy-plane for the values of (x, y) above which region lies. A general method for finding (x, y) bounds is to solve the inequality \(z_2(x,y)>z_1(x,y)\) for the bounds of z, and then use usual method to set up the double integral for (x, y).
Evaluate triple integrals There are 11 necessary items "itg; f(x, y, z); x; a; b; y; c; d; z; u; v" for evaluating triple integrals. In a simple case where the solid region is a box, the order of integration does not matter because the limits of integration are all constants. In case of variable integration limits, the order is the innermost limits involves two variables, middle limits one variable, and the outermost limits should be constants. Use "nit; f(x, y, z); x; a; b; y; c; d; z; u; v" for numerical integration.
Also use function call "itg(f(x, y, z), x, a, b, y, c, d, z, u, v)" for evaluating triple integrals, and you get the same results as those from "itg; f(x, y, z); x; a; b; y; c; d; z; u; v". But combining double or triple integrals with other operations such as "dif", "lim" is not implemented.
Examples
(1) Check itg;exp(x+y+z);x;-log(2);log(2);y;0;log(3);z;0;log(4) || will give the same result if you change the order of integration. The codes itg;1;x;0;2;y;1;3;z;2;8 || gives the volume of the region (a box).
(2) itg;x**2;x;0;1;y;2;4;z;-5;7 || itg;x**2*z**2;x;0;1;y;-1;3;z;0;6 || itg;x*y/z;x;1;2;y;0;6;z;3;5 || itg;x/(y+z)**2;x;0;2;y;1;3;z;1;5 || itg;sin(x+y+z);x;0;pi;y;pi;2*pi;z;-pi;pi || itg;cos(x+y+z);x;0;pi/2;y;0;pi/3;z;0;pi/4 || itg;r**2*sin(s);r;0;2*a*cos(s);s;0;pi/4;t;0;2*pi || nit;x**2;x;0;1;y;2;4;z;-5;7 || nit;x**2*z**2;x;0;1;y;-1;3;z;0;6 || nit;x*y/z;x;1;2;y;0;6;z;3;5 || nit;x/(y+z)**2;x;0;2;y;1;3;z;1;5 || nit;sin(x+y+z);x;0;pi;y;pi;2*pi;z;-pi;pi || nit;cos(x+y+z);x;0;pi/2;y;0;pi/3;z;0;pi/4 || nit;r**2*sin(s);r;0;2*cos(s);s;0;pi/4;t;0;2*pi ||.
Examples As in double integrals, triple integrals often involve complicated domains. Regions of triple integrals may be between bounded surfaces over complicated domains in the plane. || itg;x;z;x-y;2*x+3*y;y;0;x;x;-2;3 || itg;x-y;x;2*z;3*y;y;-z;0;z;0;1 || itg;z;z;cos(x+y);sin(x-y);y;x;0;x;0;pi/4 || itg;z;z;x+y;2*x+3*y;x;0;3;y;1;4 || itg;z;z;x+y;x*y;y;x;x**2;x;0;1 ||.
Examples itg;x+1;z;x**2+y**2;4;y;-(4-x**2)**(1/2);(4-x**2)**(1/2);x;-2;2 || nit;x+1;z;x**2+y**2;4;y;-(4-x**2)**(1/2);(4-x**2)**(1/2);x;-2;2 ||.
Examples Find \(\iiint_WydV\), if \(W\) is the region the plane \(x+2y+3z=4\) cut by the coordinate axes. Then \(\iiint_WydV=\int_0^4 \int_0^{2-x/2}\int_0^{(4-x-2y)/3}ydzdydx\), and get the result by itg;y;z;0;(4-x-2*y)/3;y;0;2-x/2;x;0;4 ||.
Examples
(1) The volume of the cylinder of \(x^2+y^2=9\) between \(z=0\) and \(z=2\) is 18\(π\) by geometry. Use a triple integral
itg;1;y;-(9-x**2)**(1/2);(9-x**2)**(1/2);x;-3;3;z;0;2 ||, or by cylindrical coordinates itg;r;r;0;3;t;0;2*pi;z;0;2 || itg(r,r,0,3,t,0,2*pi,z,0,2) ||, and you get the same result.
(2) The volume of the above cylinder between \(z=0\) and the plane \(x+y+z=6\) by itg;1;z;0;6-x-y;y;-(9-x**2)**(1/2);(9-x**2)**(1/2);x;-3;3 ||, or by cylindrical coordinates itg;r;z;0;6-r*cos(t)-r*sin(t);r;0;3;t;0;2*pi ||.
(3) The volume of the above cylinder between \(z=0\) and below the surface \(2x^2+3y^2=z\) can be obtained by itg;1;z;0;2*x**2+3*y**2;y;-(9-x**2)**(1/2);(9-x**2)**(1/2);x;-3;3 ||, or by cylindrical coordinates itg;r;z;0;2*r**2 +r**2*sin(t)**2;r;0;3;t;0;2*pi ||.
Triple integrals in cylindrical coordinates When triple integrals involve cylinders or cones, where their domains are symmetric about an axis, we often use cylindrical coordinates to simplify calculation. The conversion between rectangular and cylindrical coordinates are \(x=r\cosθ, y=r\sinθ, z=z\), where \(r\) and \(θ\) are the polar coordinates, the projection of a point \((x,y,z)\) onto the xy-plane.
The transformation formula is \(\iiint_Wf(x,y,z)dV=\int_{θ_1}^{θ_2}\int_{r_1(θ)}^{r_2(θ)}\int_{z_1(r,θ)}^{z_2(r,θ)}f(r\cosθ,r\sinθ,z)rdzdrdθ\). Note that the innermost limits of integration are two bounded surfaces represented by functions z(r, θ) of r and θ in the domain D, which is enclosed by two polar curves r1(θ) and r2(θ) for θ1 ≤ θ ≤ θ2.
Divide the region \(W\) into small boxes with height \(Δz\) and base area \(ΔA\), so its volume is \(ΔV=ΔAΔz\). In rectangular coordinates, the volume element is \(dV=dxdydz\) and in cylindrical coordinates \(dV=rdrdθdz\).
Examples
(1) Constant limits by itg;z*r**2;z;0;3;r;1;4;t;0;2*pi || itg;z+r;z;-2;4;r;-3;3;t;0;pi ||. Variable limits itg;z*r;z;0;r*sin(t);r;1;4;t;0;pi ||
itg;z;z;0;(1-r**2*sin(t)**2)**(1/2);r;sin(t);cos(t);t;0;pi ||.
(2) The volume of a cylinder \(r=2\) between \(z=0\) and \(z=x+y\) by cylindrical coordinates can be got by itg;r;z;0;r*cos(t)+r*sin(t);r;0;2;t;0;2*pi ||.
(3) Show the volume of a cylinder of radius \(a\) and height \(h\) is \(\pi a^2h\) by itg;r;z;0;h;r;0;a;t;0;2*pi ||.
(4) Show the volume of a cone of base radius \(a\) and height \(h\) is \(\frac{1}{3}\pi a^2h\) by itg;r;z;0;h*(a-r)/a;r;0;a;t;0;2*pi ||.
Example Find the volume between the surfaces \(z=x^2+y^2\) and \(z=8-x^2-y^2\). The intersection between the two surfaces is \(x^2+y^2=4\), the domain of the circle by polar coordinates are \(0≤r≤2\) and \(0≤θ≤2π\), and the volume can be got by itg;z;z;r**2;8-r**2;r;0;2;t;0;2*pi ||.
Example The integral \(∫_0^{\frac{π}{2}}∫_0^{\sqrt{1-x^2}}∫_0^{\sqrt{x^2+y^2}}zdzdydx\) would be very difficult to evaluate directly. But using cylindrical coordinates, you have \(∫_0^r∫_0^1∫_0^{\frac{π}{2}}zrdzdrdθ\), and then evaluate it by itg;z*r;z;0;r;r;0;1;t;0;pi/2 ||, which is π/16.
Triple integrals in spherical coordinates If calculation involves a sphere or cones, use spherical coordinates to evaluate triple integrals. The conversion between rectangular coordinates \((x,y,z)\) and spherical coordinates \((ρ,\phi,θ)\) is \(x=ρ\sin\phi\cosθ,y=ρ\sin\phi\sinθ,z=ρ\cos\phi\) for \(ρ≥ 0\) and \(0≤\phi≤π\) for \(ρ-\)distance to origin, \(ϕ-\)angle down from z-axis, and \(θ-\)same as cylindrical coordinates. If \(f\) is continuous on a bounded solid \(W\), then \(\iiint_Wf(x,y,z)dV=\int\int_{\theta_1}^{\theta_2}\int_{\phi_1}^{\phi_2}\int_{\rho_1(\theta,\phi)}^{\rho_2(\theta,\phi)}f(\rho\sin\phi\cos\theta,\rho\sin\phi\sin\theta,\rho\cos\phi)\rho^2\sin\phi d\rho d\phi d\theta\).
In a vertical plane with \(zr-\)coordinates,\(z=ρ\cosϕ,r=ρ\sinϕ\). Thus, \(ρ=\sqrt{r^2+z^2}=\sqrt{x^2+y^2+z^2},x=ρ\sinϕ\cosθ,y=ρ\sinϕ\sinθ\). The equations \(ρ=a\) is a sphere centered at origin, \(ϕ=\frac{π}{2}\) is the xy-plane, and \(θ=\frac{π}{4}⇒z=r=\sqrt{x^2+y^2}\) is a cone.
To check the volume element \(dV=dρdS=ρ^2\sinϕdρdϕdθ\), divide the sphere into small "box" with volume \(ΔV=ΔSΔρ\), where \(ΔS\) is the area of a small portion on surface of the sphere of radius \(ρ\). The portion of surface looks like a "rectangle" with sides \(ρΔϕ\) and \(ρ\sinϕΔθ=rΔθ\), and thus \(ΔS≈ρ^2\sinϕΔϕΔθ\), which gives the surface element \(dS=ρ^2\sinϕdϕdθ\).
Examples
(1) Show the volume of a sphere of radius \(a\) is \(\frac{4}{3}\pi a^3\) by itg;8*r**2*sin(s);r;0;a;s;0;pi/2;t;0;pi/2 ||.
(2) If \(\iiint_Wy^2dV\) is integrated over a region \(W\) of a ball of radius \(k>0\) centered at the origin, you can get the value by itg;r**2*sin(s)**2*sin(t)**2*r**2*sin(s);r;0;k;s;0;pi;t;0;2*pi ||.
(3) Find the volume of the portion of of unit sphere above the plane \(z=\frac{1}{\sqrt{2}}\). The bounds for \(ρ\) is from \(\frac{\secϕ}{\sqrt{2}}\) to 1 given \(z=ρ\cosϕ=\frac{1}{\sqrt{2}}\). Evaluate the triple integral by itg;r^2*sin(s);r;sec(s)/2^(1/2);1;s;0;pi/4;t;0;2*pi ||.
If \(f\) is continuous on \(D\) and \(J(u,v):D_0\to D\) is a one-to-one mapping on the interior of \(D_0\) such that all component functions of \(J(u,v)= ⟨x(u,v),y(u,v)⟩\) from \(f(x,y)\) have continuous first partial derivatives, then \(\iint_Df(x,y)dA=\iint_{D_0}f(x(u,v),y(u,v)|J(u,v)|dudv\), where \(J(u,v)=|\frac{∂(x,y)}{∂(u,v)}|\) and \(dxdy=|J(u,v)|dudv\).
In 3d-space, if \(J(u,v,w):W_0\to W\) is a one-to-one mapping on the interior of \(W_0\) such that all component functions of \(J(u,v,w)=⟨x(u,v,w), y(u,v,w),z(u,v,w)⟩\) have continuous first partial derivatives, then \(\iiint_Wf(x,y,z)dV=\iiint_{W_0}f(x(u,v,w),y(u,v,w),z(u,v,w))|J(u,v,w)|dudvdw\), where \(J(u,v,w)=|\frac{∂(x,y,z)}{∂(u,v,w)}|\) and \(dxdydz=|J(u,v,w)|dudvdw\).
The matrix \(J(x,y)=J(u,v)^{-1}\) and \(J(x,y,z)=J(u,v,w)^{-1}\). They are inverse of each other. The relation between \(dA=dxdy\) and \(dA'=dudv\) is \(dudv=|J(x,y)|dxdy\) or \(dxdy=\frac{1}{J(u,v)}dudv\) because the determinants satisfy \(J(x,y)J(u,v)=1\).
Recall the change of variables formula for definite integrals \(∫_a^bf(g(x))g'(x)dx=∫_{g(a)}^{g(b)}f(u)du\), where \(dx=\frac{1}{g'(x)}du\), or \(du=g'(x)dx\)
The quantity \(J(u,v)\) or \(J(u,v,w)\) is called the Jacobian determinant of the mapping, \(J(u,v)\) is a determinant of a 2 × 2 matrix consisting of the first partial derivatives of the component functions with respect to the parameters, and \(J(u,v,w)\) is a determinant of a 3 × 3 matrix of first partial derivatives. Note that \(|J(u,v)|, |J(u,v,w)|\) are absolute values of the determinants. They are the scaling factors for change of areas or volumes. To evaluate the integral, need to replace the integrand and bounds of the region. Change of variables may simplify integrands or bounds or both.
The code pattern "mat;jcb(a,b);a;[x(u,v),y(u,v)];b;[u,v]" calculates the Jacobian matrix for a general mapping in \(R^2\), and "mat;jcb(a,b);a;[x(u,v,w),y(u,v,w),z(u,v,w)];b;[u,v,w]" calculates the Jacobian matrix for a general transformation in \(R^3\), where "mat" is for matrix operations, the component functions are listed in the vector "a" (column), and the parameters u, v, w to which the derivatives are taken are listed in the vector "b" (column). Then use "det(jcb(a,b))" to calculate the determinant of a Jacobin matrix. Refer to the section Linear Algebra for more information on linear algebra or matrix operations.
The formulas for integration in polar, cylindrical and spherical coordinates are special case of change of variables for multiple integration, and you can use "jcb" module to verify these results.
Examples
(1) If J(u, v) = ⟨u - 2v, 3u + v⟩, then J(1, 1) = (-1, 4) and J(2, 0) = (2, 6). The Jacobian is 7 by
mat;det(jcb(a,b));a;[u-2*v,3*u+v];b;[u,v] ||, which implies the map is linear.
(2) If J(u, v) = ⟨2u-3v, uv⟩, then J(2, 1) = (1, 2), J(0, -1) = (3, 0), and the Jacobian |J(u, v)| is 2u + 3v by mat;det(jcb(a,b));a;[2*u-3*v,u*v];b;[u,v] ||.
(3) Let J(r, s, t) = ⟨r*sin(s)cos(2*t), r*cos(2*s)sin(t),r*cos(2*s)⟩. Then the Jacobian |J(r, s, t)| is by mat;det(jcb(a,b));a;[r*sin(s)*cos(2*t),r*cos(2*s)*sin(t),r*cos(2*s)];b;[r,s,t] ||.
Special case of change of variables The change of variables from a regular rectangle (Cartesian) system to a polar system is \(dxdy=rdrdθ\), and \(\iint_Df(x,y)dA=\int_{\theta_1}^{\theta_2}\int_{r_1(\theta_1)}^{r_2(\theta_2)}f(r\cos\theta,r\sin\theta)rdrd\theta\). The change of variables for the triple integrals \(\iiint_wf(x,y,z)dV\) in cylindrical coordinates is \(dzdxdy=rdzdrdθ\), and \(\iiint_Df(x,y,z)dV=\int_{\theta_1}^{\theta_2}\int_{r_1(\theta_1)}^{r_2(\theta_2)}\int_{z_1(r,\theta)}^{z_2(r,\theta)}f(r\cos\theta,r\sin\theta)rdzdrd\theta\). The change of variables in spherical coordinates is \(dxdydz=ρ^2\sinθdρdϕdθ\), and \(\iiint_Df(x,y,z)dV=\int_{\theta_1}^{\theta_2}\int_{\phi_1}^{\phi_2}\int_{\rho_1(\theta,\phi)}^{\rho_2(\theta,\phi)}f(\rho\sin\phi\cos\theta,\rho\sin\phi\sin\theta,\rho\cos\phi)\rho^2\sin\phi d\rho d\phi d\theta\).
Examples Use "jcb" module to verify the above special cases of change of variables.
(1) Polar coordinates J(r, θ) = ⟨
rcos(θ), rsin(θ)⟩. Rewrite it as a polar mapping x = rcos(t), y = rsin(t) and evaluate it by mat;det(jcb(a,b));a;[r*cos(t),r*sin(t)];b;[r,t] ||, which is r.
(2) Cylindrical coordinates J(r, θ z) = ⟨rcos(θ), rsin(θ), z⟩. Rewrite is as a cylindrical mapping x = rcos(t), y = rsin(t), z = z and evaluate it by mat;det(jcb(a,b));a;[r*cos(t),r*sin(t),z];b;[r,t,z] ||, which is r.
(3) Spherical coordinates J(ρ, φ, θ) = ⟨ρcos(θ)sin(φ),ρsin(θ)sin(φ), ρcos(φ)⟩. Rewrite it as a spherical mapping x = rsin(s)cos(t), y = rsin(s)sin(t), z = rcos(s) and evaluate it by mat;det(jcb(a,b));a;[r*sin(s)*cos(t),r*sin(s)*sin(t),r*cos(s)];b;[r,s,t] ||, which is ρ²sin(φ).
Example mat;det(jcb(a,b));a;[exp(v),exp(u)];b;[v,u] || gives the Jacobian eu + v for the map x = ev, y = eu. To continue evaluate the integral \(∫_1^e∫_1^exy(x^2+y^2)dxdy\), for instance, you need to put all these changes together to have \(∫_0^1∫_0^1e^{u+v}(e^{2v}+e^{2u})(e^{u+v})dudv\). Check itg;x*y*(x**2+y**2);x;1;e;y;1;e || itg;exp(2*u+4*v)+exp(4*u+2*v);u;0;1;v;0;1 || give the same results.
Summary Keep in mind that change of variables is to help evaluate a multiple integral, you need to add the Jacobian, change the differentials, integrand, and boundaries of domains, and then use "itg" module to evaluate the new integral. Note that the change of variables turns an xy-integral into a uv-integral, but the map J(u, v) transforms these domains in the opposite direction from uv-domain to xy-domain.
2 Application of Multiple Integrals
Applications of multiple integrals The total amount of a quantity distributed in a bounded region in R2 or R3 with a density (rate) function δ(x, y) or δ(x, y, z) can be found by evaluating a double or triple integral. Examples of these quantities are total mass, charges, and populations. Double and triple integrals are used to find mean values, surface areas, center of mass, moments, moments of inertia, and probabilities of random variables with joint probability density functions.
Surface areas If \(f(x,y)≥0\) has continuous first partial derivatives on a domain \(D\), then its surface area over \(D\) is \(S=\iint_D\sqrt{1+f_x^2+f_y^2}dA\), which is similar to the formula for arc length and usually hard to evaluate. The differential \(dS = \sqrt{1+f_x^2+f_y^2}dA=\sqrt{1+f_x^2+f_y^2}dxdy\) is called surface area differential.
Examples
(1) Find the area of the surface (top) cut from a cylinder \(x^2+y^2=4\) by a plane \(x+y+z=6\). Since \(z_x=-1,z_y=-1,\iint_D\sqrt{3}dA\), where the domain is the circle of radius 2 centered at the origin. The surface area is \(4\sqrt{3}π\), or check it by itg;3**(1/2)*r;r;0;2;t;0;2*pi ||.
(2) To find the surface area of the paraboloid \(z=x^2+y^2\) below \(z=9, z_x=-2x,z_y=-2y\), and \(\iint_D\sqrt{1+4z}dA\). The domain \(D\) is a circle of radius 3 centered at the origin, and you can find the result using polar coordinates and by itg;(1+4*r**2)**(1/2)*r;r;0;3;t;0;2*pi ||.
Examples
(1) Find the surface area (top) of \(x^2+y^2+z^2=4\) inside the cylinder \(x^2+y^2=2x\). The code pattern by idf;x**2+y**2+z**2;x;z || idf;x**2+y**2+z**2;y;z || find the partial derivatives \(z_x=-\frac{x}{z},z_y=-\frac{y}{z}\). So the integrand is \(\sqrt{1+z_x^2+z_y^2}=\frac{2}{z}\), and the domain is a circle of radius 1 center at (1, 0). Use polar coordinates itg;2*r/(4-r**2)**(1/2);r;0;2*cos(t);t;0;pi ||.
(2) Show the surface area of a sphere of radius \(x^2+y^2+z^2=a^2\) for \(a>0\) is \(4\pi a\) by itg;2*a*r/(a**2-r**2)**(1/2);r;0;a;t;0;2*pi ||.
Examples To find the surface area of \(x^2+y^2+z^2=9\) between \(z=1\) and \(z=2\), the domain is a ring centered at the origin. By polar coordinates itg;3*r/(9-r**2)**(1/2);r;5**(1/2);8**(1/2);t;0;2*pi ||.
Examples Show that the surface area of a right circular cone of base radius \(a\) and height \(h\) is \(\pi as\) for the slant height \(s=\sqrt{a^2+h^2}\). Since \(z=\frac{h(a-r)}{a}=\frac{h}{a}(a-\sqrt{x^2+y^2})\), use dif;(h/a)*(a-(x**2+y**2)**(1/2));x || dif;(h/a)*(a-(x**2+y**2)**(1/2));y for the first partial derivatives, and then itg;r*(a**2+h**2)**(1/2)/a;r;0;a;t;0;2*pi ||.
Mass The total mass of an object with a density \(δ\) is \(M=\iint_D δ(x,y)dA,M=\iiint_D δ(x,y,z)dV\).
Average value The average value of \(f\) is \(\bar{f}=\frac{1}{A}\iint_D f(x,y)dA,\bar{f}=\frac{1}{V}\iiint_D f(x,y,z)dV\). The weighted average value of \(f\) is \(\bar{f}=\frac{1}{M}\iint_D f(x,y)δdA,\bar{f}=\frac{1}{M}\iiint_D f(x,y,z)δdV\), where \(δ\) is the density and \(M\) represents mass.
Examples
(1) If the density \(δ(x,y)\) of a plate of radius a is proportional to the distance to its center, then the mass is calculated by itg;k*r**2;r;0;a;t;0;2*pi ||.
(2) If the density of a sphere of radius a is proportional to the distance to its center, the mass is given by itg;8*k*r**3*sin(s);r;0;a;s;0;pi/2;t;0;pi/2 ||.
(3) For a right circular cone or cylinder, if the density is proportional to its axis, then the mass is by itg;k*r**2;z;0;h;r;0;a;t;0;2*pi || itg;k*r*2;z;0;h*(a-r)/a;r;0;a;t;0;2*pi ||.
Center of mass If \(δ(x,y)\) is continuous on a lamina \(D\), the coordinates for the center of mass are \(\bar{x}=\frac{\iint_Dxδ(x,y)dA}{\iint_Dδ(x,y)dA},\bar{y}=\frac{\iint_Dyδ(x,y)dA}{\iint_Dδ(x,y)dA}\). Similarly, in space, if \(δ(x,y,z)\) is continuous on a bounded and solid region \(W\), the center of mass are \(\bar{x}=\frac{\iint_Dxδ(x,y,z)dV}{\iiint_Wδ(x,y,z)dV}\), \(\bar{y}=\frac{\iint_Wyδ(x,y,z)dV}{\iiint_Wδ(x,y,z)dV}, z=\frac{\iint_Wzδ(x,y,z)dV}{\iiint_Wδ(x,y,z)dV}\). Note that \(δ(x,y)\) is the mass density of a flat object and \(δ(x,y,z)\) is the density of an object in space.
For an object of uniform composition, the density can be viewed as a constant and is canceled out, so the calculation for its center of mass is simplified. In this case, the center of mass is also called centroid.
Centroids If an object has uniform density, the center of mass becomes geometric center (centroid) of the object, a feature of geometric shapes. In two-dimensional case, the centroids are \(\bar{x}=\frac{\iint_DxdA}{\text{area}(D)},\bar{y}=\frac{\iint_DydA}{\text{area}(D)}\). In 3d-space, the centroids are \(\bar{x}=\frac{\iiint_WxdV}{\text{volume}(W)},\bar{y}=\frac{\iiint_WydV}{\text{volume}(W)}, z=\frac{\iiint_WzdV}{\text{volume}(W)}\).
Examples
(1) The centroid of a right triangle of legs a and b is found by itg;1;y;0;b-b*x/a;x;0;a || itg;x;y;0;b-b*x/a;x;0;a ||
itg;y;y;0;b-b*x/a;x;0;a, which give the area, My, Mx, respectively, and it is (a/3, b/3). Also get the results by
itg(x,y,0,b-b*x/a,x,0,a)/itg(1,y,0,b-b*x/a,x,0,a) || for x-coordinate and itg(y,y,0,b-b*x/a,x,0,a)/itg(1,y,0,b-b*x/a,x,0,a) || for y-coordinate.
(2) The centroid of a quarter circle of radius a (placed in the first quadrant) can be got by itg;r;r;0;a;t;0;pi/2 ||
itg;r**2*cos(t);r;0;a;t;0;pi/2 || itg;r**2*sin(t);r;0;a;t;0;pi/2, and it is (4a/3π, 4a/3π). Or by itg(r**2*cos(t),r,0,a,t,0,pi/2)/itg(r,r,0,a,t,0,pi/2) ||
for x-coordinate, and itg(r**2*sin(t),r,0,a,t,0,pi/2)/itg(r,r,0,a,t,0,pi/2) || for y-coordinate.
(3) The centroid (0, 4a/3π) of the top half circle is by itg;r;r;0;a;t;0;pi || itg;r**2*cos(t);r;0;a;t;0;pi || itg;r**2*sin(t);r;0;a;t;0;pi ||.
(4) The centroid of the top cardioid r = 1 + cos(θ) is by itg;r;r;0;1+cos(t);t;0;pi || itg;r**2*cos(t);r;0;1+cos(t);t;0;pi || itg;r**2*sin(t);r;0;1+cos(t);t;0;pi, and is (5/6, 16/9π).
Examples
(1) The centroid for the top half sphere of radius a is by itg;r**2*sin(s);r;0;a;s;0;pi/2;t;0;2*pi ||
itg;r**3*sin(s)**2*cos(t);r;0;a;s;0;pi/2;t;0;2*pi || itg;r**3*sin(s)**2*sin(t);r;0;a;s;0;pi/2;t;0;2*pi || itg;r**3*sin(s)*cos(s);r;0;a;s;0;pi/2;t;0;2*pi ||, which is (0, 0, 3a/8). The z-coordinate can also be got by itg(r**3*sin(s)*cos(s),r,0,a,s,0,pi/2,t,0,2*pi)/itg(r**2*sin(s),r,0,a,s,0,pi/2,t,0,2*pi) ||.
(2) The centroid for a right circular cone of height h is by itg;r;z;0;h*(a-r)/a;r;0;a;t;0;2*pi || itg;r**2*cos(t);z;0;h*(a-r)/a;r;0;a;t;0;2*pi || itg;r**2*sin(t);z;0;h*(a-r)/a;r;0;a;t;0;2*pi || itg;r*z;z;0;h*(a-r)/a;r;0;a;t;0;2*pi, which is (0, 0, h/4). The z-coordinate can be got by
itg(r,z,0,h*(a-r)/a,r,0,a,t,0,2*pi)/itg(r*z,z,0,h*(a-r)/a,r,0,a,t,0,2*pi) ||.
Moment of inertia In the plane, if a lamina has continuous density \(δ(x,y)\), the moment of inertia (MI) about the coordinate axes is \(I_x=\iint_Dy^2δ(x,y)dA,I_y=\iint_Dx^2δ(x,y)dA\), and the MI about the origin is \(I_o=\iint_D(x^2+y^2)δ(x,y)dA\)\(=I_x+I_y\).
In a 3d-space, if a bounded solid has continuous density \(δ(x,y,z)\), the MI about the coordinate axes are \(I_x=\iiint_W(y^2+z^2)δ(x,y,z)dV,I_y=\iiint_W(x^2+z^2)δ(x,y,z)dV,I_z=\iiint_W(x^2+y^2)δ(x,y,z)dV\).
The kinetic energy of a mass \(m\) with velocity \(v\) is \(\frac{1}{2}mv^2\), and mass tells how hard it is to impart translation motion. Moment of inertia is physical equivalent of mass for rotational motion about an axis (or origin). The kinetic energy of a single mass \(m\) at distance \(r\) rotating at angular speed \(ω=\frac{dθ}{dt}\) is \(E=\frac{1}{2}mv^2=\frac{1}{2}mr^2ω^2=\frac{1}{2}I_oω^2\) for \(v=rω\) and \(I_o=mr^2\) the moment of inertia. The MI \(I_o\) tells how hard it is to rotate an object about the origin.
Example Find the MI for rotating a disk of radius b about its center (assuming δ = 1) by \(I_o=\int_0^{2π}\int_0^br^2rdrdθ=\frac{πb^4}{2}\), and the MI for rotating the smae disk about a point on its circumference is \(I_o=\int_{-π/2}^{π/2}\int_0^{2a\cosθ}r^2rdrdθ=\frac{3πb^4}{2}\). To set up the last integral, place origin at the point. Check the results by itg;r^3;r;0;b;t;0;2*pi || itg;r^3;r;0;2*b*cos(t);t;-pi/2;pi/2 ||.
Example A triangle bounded by 3x + 2y = 6 and x = 0 and y = 0 has a density x + y, the moment of inertia Ix can be calculated by itg;y**2*(x+y);y;0;(6-3*x)/2;x;0;2 and Iy by itg;x**2*(x+y);y;0;(6-3*x)/2;x;0;2 ||.
Probability If the random variables \(X\) and \(Y\) has a continuous joint density function \(f(x,y)≥0\), then the probability \(P(a≤X≤b, c≤Y≤d)=\int_a^b\int_c^df(x,y)dydx\). In general, if the domain is not a rectangle, the probability \(P[(x,y)∈D]=\iint_Df(x,y)dA\). The expected values of \(X\) and \(Y\) are \(\mu_x=\iint_Dxf(x,y)dA,\mu_y=\iint_Dyf(x,y)dA\).
Mean values If \(f(x,y)\) is continuous on a closed and bounded domain \(D\), then there is a point \(P∈D\) such that \(f(P) =\bar{f}=\frac{\iint_Df(x,y)dA}{\text{area}(D)}\), which is called mean value.
Examples The mean value (the ratio) is 25/27 by itg;x+y**2;y;0;x**2;x;0;1 || itg;1;y;0;x**2;x;0;1 ||.
If \(f(x,y,z)\) is continuous on a solid and bounded region \(W\), then the average volume is \(\bar{f}=\frac{\iiint_wf(x,y,z)dV}{\text{volume}(W)}\).
Examples Find the mean value itg;exp(x+y+z);z;0;x;y;0;1;x;0;1 || itg;1;z;0;x;y;0;1;x;0;1 ||. Or itg(1,z,0,x,y,0,1,x,0,1)/itg(exp(x+y+z),z,0,x,y,0,1,x,0,1) ||.