# Calculus with Mathsend

## How to use differentiate, integrate, limit, and series keywords

Calculus operations range from simple one order differential equations to complex ones, and sometimes the aim is just to get the final value, in those scenarios Mathsend relies on sympy to give accurate results through the keywords below:

### Differentiate()

The formats:

- differentiate(expression)
- differentiate(expression, var)

The variable argument may be omitted if there is only one variable in the expression, and partial differentials can be performed by specifying the intended variable.

For example,

- differentiate(sin(x)*exp(x)). will differentiate with respect to x
- differentiate(2x*y^2+3y +z, y) will yield a solution for when the function is differentiated with respect to y while other variables (x and z) are constants.

### Integrate()

MathSend can provide solution to both definite and indefinite integrals. Formats:

- integrate(expression)
- integrate(expression, variable)
- integrate(expression, var1, var2, ...)
- integrate(expression, variable, lower_limit, upper_limit)

The variable argument may be omitted if there is only one variable in the expression, but must be specified if there is more than one (e.g x and y). Multiple integrals can also be performed by specifying the order of the variable, and for definite integrals, the lower_limit and upper_limit are required.

For example,

- integrate(3*x^4) will integrate expression with respect to x
- integrate(3*y/x^4+8yxz, y) will integrate with respect to y
- integrate(3*y/x^4+8yxz, y, x,x,z) integrates the expression four times: first with respect to y, second with respect to x, third with respect to x again, and forth with respect to z.
- integrate(3*y/x^4+8yxz, y, 0, inf) will integrate the expression with respect to y from 0 to infinity

### Limit()

Mathsend computes Limits to a supplied function using Gruntz heuristics and algorithm.

Formats:

- limit(expression)
- limit(expression, variable)
- limit(expression, variable, lower_limit, upper_limit)

For example: limit(x*sin(1/x), x, inf)

### Series()

Asymptotic series expansions can be computed with the series keywords.

The formats:

- series(expression)
- series(expression, variable)
- series(expression, variable, lower_limit, upper_limit)

By default,`lower_limit`

= 0, and`upper_limit`

= 6

For example:

- series(sin(x)) computes the Taylor series of sin(x) up to the 6th order and it is equivalent to series(sin(x),x,0,6)
- series(sin(2x+2
*x*y^2), y, 2, 9) will compute the series with respect to y starting from the 2^{nd}to the 9^{th}.