Calculus

Let's do some calculus using Sage.

Differentiation

The derivative of $\sin(x)$ is:

sage: diff(sin(x), x)
cos(x)

The derivative of $\log(x) + x^2$ is:

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

Integration

Sage can integrate $\int x^3 dx$:

sage: f = x^3
sage: f.integral(x)
1/4*x^4

Let's compute $\int x \sin(x^2) dx$:

sage: f = x*sin(x^2)
sage: integral(f,x)
-1/2*cos(x^2)