1. Define the function

f(x) = 2 arcsin(x) + arcsin( 1 - 2 x^2 ).

So f(x) is defined for x in the interval [-1, 1]. 2. Differentiate and simplify: find f'(x) = ??

Remembering that d/du(arcsin u) = 1/sqrt(1-u^2), and using the Chain Rule, we have

```f'(x) = 2/sqrt(1 - x^2) + (-4x)/sqrt(1 - (1 - 2 x^2)^2)    (1)
= 2/sqrt(1 - x^2) + (-4x)/sqrt(4 x^2 - 4 x^4)        (2)
= 2/sqrt(1 - x^2) + (-4x)/sqrt(4 x^2 (1 - x^2))      (3)
= 2/sqrt(1 - x^2) + (-4x)/(2x sqrt(1 - x^2))         (4)
= 0.
```
Wow! If the derivative is 0, f(x) must be constant!

3. Check the unexpected answer for f'(x) by calculating f(0) and f(1). No problem so far -- these values do not contradict a fundamental theorem of calculus.
```f(0) = 2 arcsin 0 + arcsin(1 - 0) = 0 + pi/2 = pi/2.
f(1) = 2 arcsin 1 + arcsin(1 - 2) = 2 pi/2 - pi/2 = pi/2.
```
Looks constant so far.

4. Recheck f'(x) by calculating f(-1). *NOW* we have a problem.
```f(-1) = 2 arcsin -1 + arcsin(1 - 2) = 2 (-pi/2) - pi/2 = -3 pi/2.
```
This means that f(x) can't be constant, contradicting f'(x) = 0.

5. Find your error. Don't tell me that you didn't make a mistake in Step 2 -- everybody does.
The error we made was in going from (3) to (4). Putting sqrt(4 x^2) = 2x is only valid if x>=0; in general (for x real) sqrt(4 x^2) = 2 |x| so we should write
```f'(x) = 2/sqrt(1 - x^2) + (-4x)/(2 |x| sqrt(1 - x^2))                (4')
```
and this is 0 if x>0, 4/sqrt(1 - x^2) if x<0. (For x=0, f(x) is not differentiable.)

For further insight, we can simplify f(x). Suppose x is in [-1,1]; then x = sin t for some t in [-pi/2, pi/2], and by definition, arcsin x = t. What is arcsin(1 - 2 x^2)? Its value y must satisfy

```sin y = 1 - 2 x^2
= 1 - 2 sin^2 t
= cos 2t
= sin (pi/2 - 2t)
```
and y must be in [-pi/2, pi/2]. For t>=0 we can take y = pi/2 - 2t, but for t<0 we must take y = pi/2 + 2t (which obviously has the same sine as pi/2 - 2t.) Hence
`arcsin(1 - 2 x^2) = pi/2 - 2 |arcsin x|.`
Hence our original function is equal to
```2 arcsin x + pi/2 - 2 |arcsin x|
```
which is indeed constant (at pi/2) for x>=0 and equals 4 arcsin x + pi/2 for x<0.