Differential Calculus

Besides the examples on this page, please see the discussion in BasicCalculus.


Piecewise fcns, polynomials, exponential, logs, trig and hyperboic trig functions.


SAGE can compute \lim_{x\rightarrow 0}\frac{\sin(x)}{x}:

sage: limit(sin(x)/x,x=0)

Laws and properties



SAGE can differentiate x^2\log(x+a) and \tan^{-1}(x)=\arctan(x):

sage: diff(x^2 * log(x+a), x)
2*x*log(x + a) + x^2/(x + a)
sage: derivative(atan(x), x)
1/(x^2 + 1)

Another example:

sage: var('x k w')
(x, k, w)
sage: f = x^3 * e^(k*x) * sin(w*x); f
sage: f.diff(x)
k*x^3*e^(k*x)*sin(w*x) + 3*x^2*e^(k*x)*sin(w*x) + w*x^3*e^(k*x)*cos(w*x)
sage: print diff(f, x)
           3   k x               2   k x               3   k x
        k x   e    sin(w x) + 3 x   e    sin(w x) + w x   e    cos(w x)
sage: latex(f.diff(x))
{{{k {x}^{3} } {e}^{{k x}} } \sin \left( {w x} \right)} + {{{3 {x}^{2} } {e}^{{k x}} } \sin \left( {w x} \right)} + {{{w {x}^{3} } {e}^{{k x}} } \cos \left( {w x} \right)}


SAGE can verify the product rule

sage: function('f, g')
(f, g)
sage: diff(f(t)*g(t),t)
f(t)*diff(g(t), t, 1) + g(t)*diff(f(t), t, 1)

the quotient rule

sage: diff(f(t)/g(t), t)
diff(f(t), t, 1)/g(t) - (f(t)*diff(g(t), t, 1)/g(t)^2)

and linearity:

sage: diff(f(t) + g(t), t)
diff(g(t), t, 1) + diff(f(t), t, 1)
sage: diff(c*f(t), t)
c*diff(f(t), t, 1)

Rates of change, velocity

Derivatives of polys, exps, trigs, log

Chain rule

Implicit differentiation

Higher derivatives


Maximum and minimum values

You can find critical points of a piecewise defined function:

sage: x = PolynomialRing(RationalField(), 'x').gen()
sage: f1 = x^0
sage: f2 = 1-x
sage: f3 = 2*x
sage: f4 = 10*x-x^2
sage: f = Piecewise([[(0,1),f1],[(1,2),f2],[(2,3),f3],[(3,10),f4]])
sage: f.critical_points()

Optimization problems

Indeterminate Forms, L'Hopital's rule

Newton’s Method

Sequences and series

(Some schools teach this topic as part of integral calculus.)



Tests for Convergence

Power series

Taylor series

Taylor series:

sage: var('f0 k x')
(f0, k, x)
sage: g = f0/sinh(k*x)^4
sage: g.taylor(x, 0, 3)
f0/(k^4*x^4) - 2*f0/(3*k^2*x^2) + 11*f0/45 - 62*k^2*f0*x^2/945
sage: maxima(g).powerseries('x',0)

Of course, you can view the latexed version of this using view(g.powerseries('x',0)).

The Maclaurin and power series of \log({\frac{\sin(x)}{x}}) :

sage: f = log(sin(x)/x)
sage: f.taylor(x, 0, 10)
-x^2/6 - x^4/180 - x^6/2835 - x^8/37800 - x^10/467775
sage: [bernoulli(2*i) for i in range(1,7)]
[1/6, -1/30, 1/42, -1/30, 5/66, -691/2730]
sage: maxima(f).powerseries(x,0)

Applications of Taylor series

Differential_Calculus (last edited 2010-02-28 00:58:33 by slabbe)