next up previous index
Next: Fractions Up: Algebra Previous: Polynomials

Trigonometry

Let  us now consider some trigonometric expressions. For example:

\begin{displaymath}\cos^5 x + \sin^4 x + 2 \cos^2 x - 2 \sin^2 x - \cos 2x = \cos^5 x + \cos^4 x
\end{displaymath}

When you type this expression into Maxima, Maple or Mathematica, you must remember that $\cos^5 x$ is really a shorthand for $\left(\cos(x)\right)^5$. So let us try to obtain the above result in Maxima first: 
\begin{figure}
{\footnotesize
\begin{tex2html_preform}\begin{verbatim}(C53) a : ...
...
(D55) COS (X) + COS (X)
(C56)\end{verbatim}\end{tex2html_preform}}
\end{figure}

The function trigexpand
works on expressions such as $\cos{2 x}$and $\sin{\left( \alpha + \beta\right)}$. In turn function trigsimp employs the identities $\sin^2{x} + \cos^2{x} = 1$ and $\cosh^2{x} - \sinh^2{x} = 1$ to simplify expressions containing $\tan$, $\sec$, etc. to $\sin$, $\cos$, $\sinh$, $\cosh$. Further simplification, if needed, may be obtained by using function trigreduce on the result.2.4

In Maple we don't have to muck around with specialised functions for trigonometry. Maple has a general purpose wrapper called simplify, which recognises the nature of the expression and applies appropriate rules until the result is as compact and simple as possible:

\begin{figure}
{\footnotesize
\begin{tex2html_preform}\begin{verbatim}> a := cos...
...y(a);
5 4
cos(x) + cos(x)>\end{verbatim}\end{tex2html_preform}}
\end{figure}

Mathematica will do something quite different here with its own version of Simplify:

\begin{figure}
{\footnotesize
\begin{tex2html_preform}\begin{verbatim}In[15]:= a...
...= 2 Cos[-] Cos[x]
2In[17]:=\end{verbatim}\end{tex2html_preform}}
\end{figure}

We can use Maxima in order to check that

\begin{displaymath}2 \cos^2{\frac{x}{2}} \cos^4{x} = \cos^5{x} + \cos^4{x}
\end{displaymath}


\begin{figure}
{\footnotesize
\begin{tex2html_preform}\begin{verbatim}(C76) b : ...
...
(D79) COS (X) + COS (X)
(C80)\end{verbatim}\end{tex2html_preform}}
\end{figure}

Function trigrat
gives a canonical  simplified quasilinear form of a trigonometrical expression.2.5

Mathematica also has similar functions, called TrigExpand, TrigFactor, and TrigReduce, but its TrigExpand doesn't work the same way as in Maxima:

\begin{figure}
{\footnotesize
\begin{tex2html_preform}\begin{verbatim}In[33]:= a...
...----------------
16In[35]:=\end{verbatim}\end{tex2html_preform}}
\end{figure}


next up previous index
Next: Fractions Up: Algebra Previous: Polynomials
Zdzislaw Meglicki
2001-02-26