## AngouriMath

## Navigation

## Differentiation

Analytical differentation is available in AngouriMath.

## Differentiation

This is fairly simple process of analytical computations of a derivative of an expression over one variable. To perform it, call method

```
Entity expr = "a x ^ 2 + b sin(x) + c";
Console.WriteLine(expr.Differentiate("x"));
```

Output:
`2 * x * a + cos(x) * b`

If no derivative can be found, it will return node

```
Entity expr = "a and x";
Console.WriteLine(expr.Differentiate("x"));
```

Output:
`derivative(a and x, x)`

It will also happen with subexpressions when they cannot be evaluated. For example,
```
Entity expr = "{ 1, 2 } + sin(x)";
Console.WriteLine(expr.Differentiate("x"));
```

Output:
`derivative({ 1, 2 }, x) + cos(x)`

You can also use this node in your expressions, and if the first argument of this node is a numerical node, then

```
Entity expr = "x derivative(sin(x) + a x, x) + 16";
Console.WriteLine(expr.Simplify());
```

Output:
`16 + (cos(x) + a) * x`

You can also pass the third argument. It reflects the number of sequential differentiation of the same expression. Example:

```
Entity expr = "derivative(sin(x), x, 2)";
Console.WriteLine(expr.Simplify());
Entity expr2 = "derivative(derivative(sin(x), x), x)";
Console.WriteLine(expr2.Simplify().InnerSimplified);
```

Output:
```
-sin(x)
-sin(x)
```

In other words, Extension:

2019-2021 Angouri · Project's repo · Site's repo · Octicons