# How can this trigonometrics equation be solved exactly, if possible?

I was working on an approximation for the sine function, in which I needed to calculate the maximum error to work on a compensation polynomial. My approximation was this:

$$f(x) = \frac {4} {\pi^2} x (\pi - |x|)$$

Then, obviously the error is found by substracting that from $\sin(x)$. In order to find the x-coordinate of the maximum error I took the derivative and and set it equal to zero.

\begin{align*} \mathrm{err}(x) &= \sin(x) -f(x)\\ \mathrm{err}'(x) &= \cos(x) + \frac {8} {\pi^2}|x| - \frac 4 {\pi} \\ \mathrm{err}'(x) &= 0 \rightarrow \cos(x) = \frac 4 \pi - \frac 8 {\pi^2}|x| \end{align*}

But I'm only a highschool student and I have no knowledge of the maths required to solve that last equation, if possible. How would one go into solving that last equation exactly?

A small image:

For my particular purpose it would suffice by calculating the value numerically and continue, but just purely for interest I'd like to know the exact value. Not homework.

-
Equations of that kind generally can't be solved exactly. –  Qiaochu Yuan Feb 17 '12 at 17:58
Be careful about taking the derivative. The function $f(x) = |x|$ is not differentiable at $x = 0$, and so your function $err(x)$ is also not differentiable at $x = 0$. –  JavaMan Feb 17 '12 at 17:58
@JavaMan: While you are right I am only interested in the range $(0, \pi)$ so it doesn't really matter. I know that $0$ and $\pi$ are zeroes of $f$ and $sin$, so $err$ is $0$ there anyway. –  orlp Feb 17 '12 at 18:04
Would $\sin x=\cos(x-\frac{\pi}{2})=\sum\limits_{n=0}^\infty(-1)^n\frac{(x-\frac{\pi}{2})^{2‌​n}}{(2n)!}$ help you any? It's a Taylor series, meaning that if you take the first few terms, at some value $x$, then the approximation error is equal to the next term with some value $\xi\in[0,|x|]$ in place of $x$. –  bgins Feb 17 '12 at 18:18
@bgins: my previous attempts have been with Taylor series, my goal is to make a slightly imprecise but blazing fast $sin$ function. After trying to approximate $sin$ with parabolae I got much better results. My current best is 0.00109 worst and 0.000505 average error with 4 multiplications and 2 additions. –  orlp Feb 17 '12 at 18:24