# What's $\frac{dy}{dx}$ of function $y=\frac 12{\sin x}$?

$(1)\quad$ How to differentiate $y=\frac 12 \sin x$?

I know that $\frac{dy}{dx}$ of $y=\sin x$ is easy to calculate: $\frac{dy}{dx} = \cos x$. But what if there is a coefficient preceding before it?

$(2)$ Another question is: Does the following equality of functions hold? $$\frac{x(x^2+1)}{x^2+1}\overset{?}{=}x$$

Please explain this because I know that function $\dfrac{x\cdot x}{x}$ does not equal function $x$ (the first function is not defined at $0$ but the second one is defined at $0$).

But the question I asked, the domain of the function can be any number according to what I think because the denominator cannot be zero, it's always a positive number $x^2+1$.

• To your second question, since $x^2+1$ is never $0$ (at least in the real numbers) $\frac{x^2+1}{x^2+1}=1$ and $\frac{x(x^2+1)}{x^2+1} = x$ for all $x$. So yes, the functions are equal. – Thomas Andrews Sep 11 '14 at 13:10
• Do you mean $\frac{1}{2\sin x}$ or $\frac{1}{2}\sin x$? – Thomas Andrews Sep 11 '14 at 13:11
• I mean 1/2 (sin x) – off99555 Sep 11 '14 at 13:13
• One should avoid different questions in a same question on MSE. – user37238 Sep 11 '14 at 13:16
• This is my first time using this website, I will be aware next time. – off99555 Sep 11 '14 at 13:18

Question $(1):\quad$ Given $y = \dfrac 12 \sin x$:

$$\frac{dy}{dx} = \frac{d}{dx}\left(\frac 12 \sin x\right) = \frac 12\cdot \frac{d}{dx}(\sin x) = \frac 12 \cos x$$

$$y = a f(x)\implies \frac{dy}{dx} = \frac{d}{dx}(a f(x)) = af'(x)$$ for all constants $a$.

Question $(2):$

$$\frac {x(x^2 + 1)}{x^2 + 1 } = x \quad \forall x \in \mathbb R$$

This happens to be the case in this example because there are no real values of $x$ at which the left-hand side is undefined. Specifically, as you note, $x^2 + 1>0$ for all $x$, and hence the function is defined everywhere. So we may cancel the common factor $x^2 + 1$ without changing the function in any way.

In the case of $f(x) = \frac{x^2}{x}$, which you refer to, here we do have problems with simply canceling a common factor of $\,x.\,$ Specifically, $\,\dfrac{x^2}{x}\,$ is undefined at $x = 0$, whereas the function $g(x) = x$ is defined everywhere, so the functions are not equivalently defined, i.e., they are not equivalent functions.

• I would say that the first response is missing one sign "=" -> ambiguity. – georg Sep 11 '14 at 14:08
• Thanks, @georg. I didn't catch that until you mentioned it.. – amWhy Sep 11 '14 at 14:19

For the first part of your question, you can remove constants when differentiating:

$$\frac{\mathrm{d}}{\mathrm{d}x}\big(a\cdot f(x)\big)=a\frac{\mathrm{d}}{\mathrm{d}x}f(x)$$

You can prove this with the product rule by finding $a\frac{\mathrm{d}}{\mathrm{d}x}f(x)+f(x)\frac{\mathrm{d}}{\mathrm{d}x}a$ & noting that the derivative of a constant is $0$. It implies that your derivative is $\frac{\mathrm{d}}{\mathrm{d}x}\big(\frac{1}{2}\sin(x)\big)=\frac{1}{2}\frac{\mathrm{d}}{\mathrm{d}x}\sin(x)$.

For the second part of the question, it is valid to cancel terms in a function but just be aware that the function's domain should stay the same. If the original function is undefined at a number, it should stay that way. As Thomas Andrews points out, $x^2+1$ is never $0$ for real $x$ so you can effectively cancel the $\frac{(x^2+1)}{(x^2+1)}$ term.

• I got the edit wrong - he wanted $y=\frac{1}{2}\sin x$. Sorry. – Thomas Andrews Sep 11 '14 at 13:14
• @ThomasAndrews Ah, thanks for letting me know :) No problem by the way, I've done it before too. – Jam Sep 11 '14 at 13:14
• Thank you very much for your help. I would like to vote both of you up but I can't. My reputation is not high enough to do that. Both answers are very useful for me. But I don't understand what setting a as a function of x mean. Can you show me please? – off99555 Sep 11 '14 at 14:25
• @off99555 Glad I could help. What I meant by "setting it as a function" was that, by using the product rule, we can find the derivative of $f(x)\cdot g(x)$ as $f(x)g'(x)+g(x)f'(x)$. If we say that $g(x)$ is a constant $a$, we could find the derivative of $a\cdot f(x)$. Since the derivative of any constant is $0$, it shows us that we can take out the constant. So $\frac{d}{dx}(\frac{1}{2}\sin(x))=\frac{1}{2}\frac{d}{dx}\sin(x)$. Does that make sense? – Jam Sep 11 '14 at 14:45
• Sure. That make sense! That's what I'm looking for, the fundamental explanation. – off99555 Sep 17 '14 at 15:46