2.10.1 Differentiation, integration, etc

To compute $ \frac{d^4\sin(x^2)}{dx^4}$ :

sage: diff(sin(x^2), x, 4)
16*x^4*sin(x^2) - 12*sin(x^2) - 48*x^2*cos(x^2)

To compute, $ \frac{\partial (x^2+17y^2)}{\partial x}$ , $ \frac{\partial (x^2+17y^2)}{\partial y}$ :

sage: x, y = var('x,y')
sage: f = x^2 + 17*y^2
sage: f.diff(x)
2*x
sage: f.diff(y)                                
34*y

To compute $ \int x\sin(x^2)  dx$ , $ \int_0^1 \frac{x}{x^2+1}  dx$ :

sage: integral(x*sin(x^2), x)
      -cos(x^2)/2
sage: integral(x/(x^2+1), x, 0, 1)
      log(2)/2

To compute the partial fraction decomposition of $ \frac{1}{x^2-1}$ :

sage: f = 1/((1+x)*(x-1))
sage: f.partial_fraction(x)
1/(2*(x - 1)) - 1/(2*(x + 1))
sage: print f.partial_fraction(x)
                     1           1
                 --------- - ---------
                 2 (x - 1)   2 (x + 1)

To compute the Laplace transform of $ t^2e^t - \sin(t)$ :

sage: s = var("s")
sage: t = var("t")
sage: f = t^2*exp(t) - sin(t)
sage: f.laplace(t,s)
2/(s - 1)^3 - 1/(s^2 + 1)

See About this document... for information on suggesting changes.