# Derivative of a function w.r.t. another function.

How is this? I'm getting $(-\tan(x))$. Here's my attempt:

Let $u=\sin(x)$ and $v=\cos(x)$. Then, the derivative we seek is,

$$\frac{\mathrm dv}{\mathrm du}$$

Using chain rule, we have,

$$\frac{\mathrm dv}{\mathrm du}=\frac{\mathrm dv}{\mathrm dx}\cdot \frac{\mathrm dx}{\mathrm du}=(-\sin(x))\cdot\frac{1}{\cos(x)}=(-\tan(x))$$

Here's the W|A link (shortened by Bit.ly) if anyone wants to verify.

• dx/du is not quite the same as the reciprocal of du/dx. – user217285 Jun 21 '15 at 22:51
• @Nitin, please provide sources to support your claim. Also, can you post an answer as to how one can manually get the answer as $\cot(x)$ ? – tom_cruise Jun 21 '15 at 22:53
• @tom_cruise It's a basic differentiation rule. If I have the function $y=x^2$, then $y'=2x$, and $x'=\frac{1}{2\sqrt{y}}$; the two are not inverses. – HDE 226868 Jun 21 '15 at 22:55
• Actually, HDE, in your example, we see $x'=\frac{1}{2\sqrt y}=\frac{1}{2x}=\frac{1}{y'}$, so it does hold. – Alex Mathers Jun 21 '15 at 23:01
• WA is interpreting the $d$'s as parameters. So the application views $d \cos x/d\sin x$ as $d \times \cos x$ divided by $d \times \sin x$, which is $\cot x$. Your answer is fine. – Mark Viola Jun 21 '15 at 23:02

WA interprets the $d$ as a constant, so they cancel out. The resulting fraction, $\frac{\cos x}{\sin x}=\cot x$.

• Damn! Thanks a lot! – tom_cruise Jun 21 '15 at 23:00
• Wish I had made that comment. ;-)) – Mark Viola Jun 22 '15 at 0:08

To do the calculation a more plausible way, $$\frac{d}{d\sin{x}}\cos{x} = \frac{d}{d\sin{x}}\sqrt{1-\sin^2{x}} = \frac{d}{dy}\sqrt{1-y^2},$$ by writing $y=\sin{x}$ (mere replacement of symbols, doesn't mean anything more) $$\frac{d}{dy}\sqrt{1-y^2} = -\frac{y}{\sqrt{1-y^2}} = -\frac{\sin{x}}{\cos{x}} = -\tan{x},$$ so your answer is correct.

My guess is that W|A is misinterpreting your input: for example, this doesn't do what you would expect either. It's probably just interpreting $d$ as a constant, so it thinks it is just doing fraction arithmetic.

• I think you meant $(-\tan x)$ and not $(-\cot x)$. Anyway, thank you! I can't accept both answers so I'm upvoting this one instead. :) – tom_cruise Jun 21 '15 at 23:04
• Ah yes, thank you. – Chappers Jun 21 '15 at 23:08
• This is perhaps plausible, but such calculations should always be taken with care. “Derivative of a function WRT another function”, as such, doesn't really make any sense unless the latter is explicitly a function of a function (i.e. a functional). $\cos$ is not really a functional, it's just a real-valued function. – leftaroundabout Jun 22 '15 at 14:07
• @leftaroundabout Agreed, although it should hold whenever the chain rule does (that being essentially what I have used, although I have not said so explicitly). – Chappers Jun 22 '15 at 15:15

To find $\frac{dx}{du}$ we see $x=\arcsin u$. Then,

$$\frac{dx}{du}=\frac{1}{\sqrt{1-u^2}}=\frac{1}{\sqrt{1-\sin^2 x}}=\frac{1}{\cos x}$$

so that step isn't wrong like Nitin said. I don't see why your solution is wrong, I'd love to see insight anybody else has.

As some others have said, W|A must just be canceling the $d$'s. Your answer is A-okay!!