# UltimaCalc

## Doing Algebra with UltimaCalc

Doing Algebra with UltimaCalc
You can use UltimaCalc's Symbolic Algebra module on a wide range of algebra problems. You can simplify algebraic expressions, divide a polynomial by another, find the GCD of two polynomials. You can do calculus. Differentiate an expression. Find the integral of an expression. Ask Algebra UltimaCalc how to find an integral. Define your own functions and work to unlimited precision.
Simplify Expressions

Algebra UltimaCalc can simplify a complicated expression like `(6 + 3*x + 2*y + x*y) / (6 + 3*x - 2*y - x*y)` by removing a factor common to both numerator and denominator to obtain `(3 + y)/(3 - y)`.

Even more dramatically, it will simplify the following expression:
`(x^2 / (4 - x^2)^(3/2) + 1 / (4 - x^2)^(1/2)) / (1 + x^2 / (4 - x^2))^(3/2)` to obtain the result `1/2`.

Algebra UltimaCalc knows a bit about trigonometry. For example, it automatically simplifies `sin(pi/6)` to `1/2` and converts `sin(x+pi/2)` to `cos(x)`. It can simplify expressions like:
`sin(x)^3 + cos(x + pi/6)^3 - sin(x + pi/3)^3 + 3/4*sin(3*x)`, in this case obtaining the result `0`.

Polynomials

Algebra UltimaCalc can divide one polynomial by another. For example it can divide the polynomial
`5 + 6*x + 119/10 * x^2 + 359/30*x^3 + 43/5*x^4 + 4*x^5` by the polynomial
`2 + 3/2*x + 3*x^2`, giving the quotient as
`3/2 + 2*x + 11/5 * x^2 + 4/3*x^3` and the remainder as `2 - 1/4*x`.

It can calculate the greatest common divisor of two polynomials. For example, the GCD of the polynomial
`45/2 - 39/4 * x - 35/4 * x^2 + 2 * x^3 + x^4` and the polynomial
`-75/4 - 115/4 * x - 91/16 * x^2 + 59/8 * x^3 + 5/2 * x^4` is found to be `-5 + 1/2 * x + x^2`.

There is a function for factorising polynomials. For example, the factors of polynomial
`-45 + 123*x - 104*x^2 + 28*x^3` are found to be:
`28*(-3/2 + x)^2 * (-5/7 + x)`.

Convert to partial fractions. Given a ratio of two polynomials, such as
`(8 + 12*x + 16*x^2) / (1 + x - x^2 - x^3)`, the partial fraction expansion can be found as:
`-9/(-1 + x) + 6/(1 + x)^2 - 7/(1 + x)`.

Calculus

You can differentiate an expression, or find a partial derivative. For example, you can differentiate with respect to `x` the following expression:
`(6 + 3*x + 2*y + x*y)` and obtain the result `3 + y`. Differentiating the same expression with respect to `y` gives the result `2 + x`.

You can also find derivatives of higher order. For example, the instruction
`diff(a*x^2 + b*x^3, x, 2)` finds the second derivative with respect to `x` of the expression `a*x^2 + b*x^3`, giving the result `2*a + 6*b*x`.

Algebra UltimaCalc can integrate many expressions, and tell you how it found the result. For example, the multiple-instruction line:
`integrate(x*sin(x), x); how()` finds the integral of `x*sin(x)` to be `sin(x) - cos(x)*x`. The instruction `how()` shows the explanation:

"Integrate by parts using the equation:
"Integral( sin(x) * x ) = -cos(x) * x + Integral( cos(x) )
"   cos(x) found in integral table"

It is easy to generate Taylor series. The following instruction finds the Taylor series for the expression `tan(x)^(1/2)` in the vicinity of `x = pi/4`:
`taylor(tan(x)^(1/2), x, pi/4, h, 5)`. This finds terms up to the 5th order. The result is:
`1 + h + 1/2*h^2 + 5/6*h^3 + 17/24*h^4 + 121/120*h^5` where `h = x - pi/4`.

Other Features

You can assign values to symbols, and define your own functions. You can manipulate equations. You can use complex numbers if you wish. You can perform polynomial expansion and polynomial decomposition.

And you can calculate to unlimited accuracy. For example, you can calculate the factorial of 40 as `40!` to obtain the 48-digit result `815915283247897734345611269596115894272000000000`.

Much larger numbers are easily possible. `200!` gives a 375-digit result, shown here with breaks inserted after every 60 digits:

```788657867364790503552363213932185062295135977687173263294742 533244359449963403342920304284011984623904177212138919638830 257642790242637105061926624952829931113462857270763317237396 988943922445621451664240254033291864131227428294853277524242 407573903240321257405579568660226031904170324062351700858796 17892222278962370389737472e49```

The `e49` at the end indicates that 49 trailing zeros have been omitted in the interests of brevity.