Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

When I feed WolframAlpha an expression like $\sin({\pi\frac{2}{3}})$, it correctly prints that this is equal to $\frac{\sqrt3}{2}$, instead of the decimal expansion $0.866025403\ldots$.

Perhaps it has a lookup table for common fractions of $\pi$. Or is it likely to be more sophisticated? Does it solve the convergence of the series expansion for $\sin(x)$?

share|improve this question
4  
This isn't really a mathematical question, but a question about WA's implementation. Since WA is not open source, we can only guess. I strongly doubt it is using the power series. It is probably just doing the first thing - finding a rational multiple of $\pi$ and doing a lookup. –  Thomas Andrews May 16 at 13:01
    
Can you put your comment into an answer with reasons for your claims? –  user151409 May 16 at 13:31
1  
As described in the documentation: "FunctionExpand uses an extension of Gauss's algorithm to expand trigonometric functions with arguments that are rational multiples of $\pi$." –  Brendon May 16 at 20:56
add comment

3 Answers 3

up vote 1 down vote accepted

It must be that $\sin\left(\dfrac{p}{q}\pi\right)$ is algebraic. To see why check out this question.

I am almost certain that W|A doesn't use power series unless the value is very small simply because it would be too slow to calculate the value of arbitrary trig functions using power series. It is more likely that there is a certain class of rational numbers such as $\frac{1}{3}$ where the forms of $\sin(\frac{\pi}{3})$ and $\cos(\frac{\pi}{3})$ are known and then formulae such as the double angle formula gives results for other rational numbers such as $\sin({\frac{2\pi}{3}})$. The result is then simplified and sent to the user.

This is only a conjecture as I do not have access to any Mathematica source code.

Here is an example. Suppose you know that $$\sin\left(\dfrac{\pi}{2}\right) = 1 \quad\text{and}\quad \cos\left(\dfrac{\pi}{2}\right) = 0.$$

We know that $$\sin^2(\theta) = \dfrac{1-\cos(2\theta)}{2}.$$

It must be that:

$$\sin^2\left(\dfrac{\pi}{4}\right) = \dfrac{1}{2} \quad\text{and}\quad \cos^2\left(\dfrac{\pi}{4}\right) = 1-\dfrac{1}{2} = \dfrac{1}{2}$$

$$\sin\left(\dfrac{\pi}{4}\right) = \dfrac{\sqrt{2}}{2} \quad\text{and}\quad \cos\left(\dfrac{\pi}{4}\right) = \dfrac{\sqrt{2}}{2}.$$

Continuing...

$$\sin\left(\dfrac{\pi}{8}\right) = \dfrac{\sqrt{{2-\sqrt{2}}}}{2} \quad\text{and}\quad \cos\left(\dfrac{\pi}{8}\right) = \dfrac{\sqrt{{2+\sqrt{2}}}}{2}$$

$$\sin\left(\dfrac{\pi}{16}\right) = \dfrac{\sqrt{2-\sqrt{{2+\sqrt{2}}}}}{2} \quad\text{and}\quad \cos\left(\dfrac{\pi}{16}\right) = \dfrac{\sqrt{2+\sqrt{{2+\sqrt{2}}}}}{2} $$

Which agrees with W|A.

share|improve this answer
add comment

With Mathematica one gets

In[2]:= Sin[2 \[Pi]/3]

Out[2]= Sqrt[3]/2

Wolfram|Alpha possibly just use Mathematica's native capability. About how that's implemented in Mathematica, if you really need to know it, ask it on mathematica.stackexchange.com. My guess is that it uses look-up table for efficiency.

share|improve this answer
add comment

Perhaps it has a lookup table for common fractions of π. Or is it likely to be more sophisticated?

All trigonometric functions of rational multiples of $\pi$ are algebraic numbers. This follows from the formula(s) attributed to Leonhard Euler and Abraham de Moivre. Is this what you had in mind?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.