# Computing Partials of inverse trig function

## Problem:

Find the partial derivatives w.r.t. x and y for

> f := (x,y) -> arccos(x*y);

f := (x, y) -> arccos(x y)
 evaluate the partials at (0.5,-0.5).

### Solution:

 Don't remember the derivative of "arccos"? I never remember it myself either. But here is how you can compute it. Use the fact that if v() is the inverse function of u() then,

> v(u(x)) = x:
 So by the chain rule we get

> diff(v(u(x)),x) = 1;

/d      \
D(v)(u(x)) |-- u(x)| = 1
\dx     /
 and if we call y=u(x) and x=v(y) we can write:

> ;

d            1
-- v(y) = -------
dy        d
-- u(v(y))
dx
 so that's the general formula. Now use u=cos and v=arccos to obtain,

> Diff(arccos(y),y) = 1/(-sin(arccos(y)));

d                     1
-- arccos(y) = - -----------
dy                     2 1/2
(1 - y )
 the last simplification follows from the fact that the derivative of cos is -sin and the fact that sin = sqrt(1-cos^2) Of course we could have just done,

> diff(arccos(y),y);

1
- -----------
2 1/2
(1 - y )
 but that's no fun.

 Now the partials. The partial w.r.t. the first ([1]) argument of f evaluated at (0.5,-0.5) is given by:

> D[1](f)(0.5,-0.5);

.5163977795
 ghosh that was easy! Now the other partial w.r.t. y the second ([2]) argument of f.

> fy := D[2](f);

x
fy := (x, y) -> - --------------
2  2 1/2
(1 - x  y )
 now evaluate:

> fy(0.5,-0.5);

-.5163977795
 Done!

Link to the commands in this file
Carlos Rodriguez <carlos@math.albany.edu>