Calculus: derivatives, integrals and limits

Example 1. We set a polynom symbolically. First and third derivatives with respect to x are obtained.

f=x^5-2x^3-1
D[f,x]
D[f,{x,3}]

-1 - 2 x^3 + x^5

-6 x^2 + 5 x^4

-12 + 60 x^2

The same commands can be written with the help of palettes for mathematical symbols. If we use f' then we will recieve it as a substitution. То calculate the derivative we use  ∂_     и    ∂_ (, ) .  For the third derivative we add another x :

f = x^5 - 2x^3 - 1 f^′ f1 = ∂_x f f3 = ∂_ (x, x, x) f

-1 - 2 x^3 + x^5

(-1 - 2 x^3 + x^5)^′

-6 x^2 + 5 x^4

-12 + 60 x^2

One can reperesent all functions by a declaration like this:

h[x_] := x^5 - 2x^3 - 1 ∂_x h[x] h[1]

-6 x^2 + 5 x^4

-2

Example 2. Let us see the graphics of the derived functions from Example 1. Obviously interesting is the behaviour in the interval [-2,2] which is why we show the derivatives only in this interval.

g1 = Plot[f, {x, -5, 5}] g2 = Plot[f1, {x, -2, 2}] g3 = Plot[f3, {x, -2, 2}]

[Graphics:HTMLFiles/index_14.gif]

⁃Graphics⁃

[Graphics:HTMLFiles/index_16.gif]

⁃Graphics⁃

[Graphics:HTMLFiles/index_18.gif]

⁃Graphics⁃

Example 3. We define a function of two variables. The partial derivatives with respect to x is found, then to y, in the end - the mixed derivative ∂_ (x, y).

g[x_, y_] := 7x^2 - y^3 - Log[x] ∂_x g[x, y] ∂_y g[x, y] ∂_ (x, y) g[x, y]

-1/x + 14 x

-3 y^2

0

Example 4. The variable f is nullified. We define the symbolical derivative.

f = .
D[f[x],x]
D[5* x *f[x], x]

f^′[x]

5 f[x] + 5 x f^′[x]

Example 5. A new value is set to f, the old one is deleted automatically. An undefined integral is derived. In the end - a defined integral: a precise value and an approximate value.

f = (1 - 2x^3)/(2 + 3x) ∫fxIntegrate[f, x]    &nb ...         (* Here the symbol % takes the preceding result *)

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

1/81 (-6 x (4 - 3 x + 3 x^2) + 43 Log[2 + 3 x])

1/81 (-6 x (4 - 3 x + 3 x^2) + 43 Log[2 + 3 x])

1/81 (-24 + 43 Log[5/2])

0.19013

Example 6. We set a function with the name newf.  The derivative with respect to x  and a double integral are calculated. Ultimately the result is given numerically.

newf[x_, y_] := x^4 + 3y d = ∂_x newf[x, y] ∫_0^1∫_1^2newf[x, y] yx %//N

4 x^3

47/10

4.7

Example 7. We set a trigonometric function. We want to carry out the definite integral, but the system is having difficulties, because we have singularities in the function Cos[ ]. Despite the slow calculations we get a result. If calculations are too slow we can interrupt them by pressin ALT + . or from the Kernel/Abort Evaluation menu.

f=. f[x_, y_] := Cos[( x)/y]  ∫_0^π∫_0^πf[x, y] xy  ... , π}]     (* Approximate integration by numerical method *)   

-1/4 π^2 (π - 2 (Cos[1] + Sin[1] + SinIntegral[1]))

3.73594

3.73594

NIntegrate :: slwcon : Numerical integration converging too slowly; suspect one of the followi ... r integrand is oscillatory try using the option Method->Oscillatory in NIntegrate.  More…

NIntegrate :: ncvb : NIntegrate failed to converge to prescribed accuracy after 13 recursive bisections in y near {x, y} = {3.000902059754438`, 0.0019899063331735444`} .  More…

3.73532

Example 8. Here we show the graphics of the function from the previous example so that the singularities can be seen.

Plot3D[f[x,y],{x,0,1},{y,0,1}]

                                      1 Power :: infy : Infinite expression  --- encountered. More…                                      0.`

∞ :: indet : Indeterminate expression 0.` ComplexInfinity encountered. More…

                                      1 Power :: infy : Infinite expression  --- encountered. More…                                      0.`

∞ :: indet : Indeterminate expression 0.` ComplexInfinity encountered. More…

                                      1 Power :: infy : Infinite expression  --- encountered. More…                                      0.`

General :: stop : Further output of Power :: infy will be suppressed during this calculation. More…

∞ :: indet : Indeterminate expression 0.` ComplexInfinity encountered. More…

General :: stop : Further output of ∞ :: indet will be suppressed during this calculation. More…

Plot3D :: plnc : f[x, y] is neither a machine-size real number at {x, y} = {0.`, 0.`} nor a list of a real number and a valid color directive. More…

Plot3D :: plnc : f[x, y] is neither a machine-size real number at {x, y} = {0.041666666666666664`, 0.`} nor a list of a real number and a valid color directive. More…

Plot3D :: plnc : f[x, y] is neither a machine-size real number at {x, y} = {0.08333333333333333`, 0.`} nor a list of a real number and a valid color directive. More…

General :: stop : Further output of Plot3D :: plnc will be suppressed during this calculation. More…

Plot3D :: gval : Function value Indeterminate at grid point xi = 1, yi = 1 is not a real number. More…

Plot3D :: gval : Function value Indeterminate at grid point xi = 2, yi = 1 is not a real number. More…

Plot3D :: gval : Function value Indeterminate at grid point xi = 3, yi = 1 is not a real number. More…

General :: stop : Further output of Plot3D :: gval will be suppressed during this calculation. More…

[Graphics:HTMLFiles/index_60.gif]

⁃SurfaceGraphics⁃

Example 9. New function and calculation of an integral with inconsistant boundaries.

f=. ;     f = x^2 + 1/(1 + y^2) ∫_0^1∫_0^x^(1/2) fyx N[%]

x^2 + 1/(1 + y^2)

-5/7 + π/2

0.856511

Exampleр 10. This is an example of a triple integral. First the exact and then the approximate values are found. The latter is shown with double accuracy.

∫_0^1∫_x/2^x∫_ (x + y)/2^(x + y) 1/(1 + x + y + z) zyx %//N

1/432 (-1408 Log[4] + 675 Log[5] - 216 Log[8] + 676 Log[13] - 72 Log[256])

0.0462077

RowBox[{0.0462077, }]

The upper example can be set in a usual way like this:

f= 1/(1+x+y+z)
Integrate[f,{x,0,1},{y,x/2,x},{z,(x+y)/2,x+y}]
N[%]

1/(1 + x + y + z)

1/432 (-1408 Log[4] + 675 Log[5] - 216 Log[8] + 676 Log[13] - 72 Log[256])

0.0462077

Example 11. Let us examine another  function with singularities. The system does not find it difficult to draw the graphics even though in the point x=0 the function is not defined. Due to the large gap however, in a larger interval the zero is skipped.

f = Sin[x]/x Plot[f, {x, 0, 10}] Plot[f, {x, 0, 100}]

Sin[x]/x

[Graphics:HTMLFiles/index_75.gif]

⁃Graphics⁃

[Graphics:HTMLFiles/index_77.gif]

⁃Graphics⁃

Example 12. Let us find some boundaries and the indefined integral.

Limit[f, x0] Limit[f, xInfinity] ∫_0^∞fx

1

0

π/2

Example 12. Another function with sinugularities.

h = (x + 1)/(1 + x^2 - x^4) Plot[h, {x, -10, 10}]

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

[Graphics:HTMLFiles/index_85.gif]

⁃Graphics⁃

Example 12. Below are the graphics in suitably chosen intervals.

Plot[h,{x,-1, 1}]
Plot[h,{x,-1.5, -1.2}]  

[Graphics:HTMLFiles/index_87.gif]

-Graphics-

[Graphics:HTMLFiles/index_88.gif]

-Graphics-

Created by Mathematica  (October 10, 2007)