# Can I compute $\frac{dy}{dx}$ of $y=x\sqrt{3x+1}\sqrt{x+1}$ by taking $ln$ on both sides

My teacher has suggested that to compute $\frac{dy}{dx}$ of $y=x\sqrt{3x+1}\sqrt{x+1}$, it's better to take $ln$ on both sides of the equation $y=x\sqrt{3x+1}\sqrt{x+1}$, and try taking derivative of logarithms on both sides, and then solve for $\frac{dy}{dx}$. But I am confused because when you consider the function $y=x\sqrt{3x+1}\sqrt{x+1}$, $y \lt 0$ for $-1/3 \lt x \lt 0$, so $ln(y)$ is not defined for $-1/3 \lt x \lt 0$, i.e. we cannot take logarithm for entire domain in which $y=x\sqrt{3x+1}\sqrt{x+1}$ is defined for. In this case, can we still compute $\frac{dy}{dx}$ by taking $ln$ on both sides, like my teacher is suggesting?

Thank you,

• but my teacher is saying to compute the derivative, we first take $ln$ on both sides, which we can't, if $-1/3 \lt x \lt 0$ – jschnieder Sep 22 '17 at 23:06
• I think you can do that because in the case you mention the $y$ is complex, but exists. More complex case is $x=0$. – Gevorg Hmayakyan Sep 22 '17 at 23:08
• @GevorgHmayakyan but $ln(y)$ is undefined if $y \lt 0$ – jschnieder Sep 22 '17 at 23:09
• rapidtables.com/math/algebra/ln/Ln_of_Negative_Number.htm please take a look at this. – Gevorg Hmayakyan Sep 22 '17 at 23:10
• @JDlikesCoffee this is a very sharp question for a student to ask and as a teacher I would encourage you to keep asking such good questions. – Randall Sep 23 '17 at 0:30

Multiply both sides of the equation by $-1$, $$-y=-x\sqrt{3x+1}\sqrt{x+1}$$ Now that both sides are positive you can take the logarithm: $$\ln(-y)=\ln(-x)+\frac{1}{2}\ln(3x+1)+\frac{1}{2}\ln(x+1)$$ Then take the derivative with respect to $x$ (note that $\ln(-x)'=\frac{-1}{-x}=\frac{1}{x}$) $$\frac{y'}{y}=\frac{1}{x}+\frac{3}{2(3x+1)}+\frac{1}{2(x+1)}$$ $$y'=x\sqrt{3x+1}\sqrt{x+1}\left(\frac{1}{x}+\frac{3}{2(3x+1)}+\frac{1}{2(x+1)}\right)$$

• Thank you for your help, – jschnieder Sep 22 '17 at 23:52

Your teacher just wanted to make things simpler because you have $\ln´ (f(x))=\dfrac {f´(x)}{f(x)}$ and right-hand side evaluates to a sum of three functions under the workings of the logarithm.

But you should not take the logarithm of points where it is not defined, if you ask me, unless you can transform everything to become strictly positive.

I think that even better approach here would be to square both sides, then at the left side you get $2y(x)y`(x)$ and on the right hand side you then take the derivative of a polynomial and you get as a bonus no problems with domain.

Pedestrian approach:

1) $x\gt 0$: $\log$ of the function is defined.

2) $x=0:$ $\log$ is not defined

3)$-1/3 \lt x\lt 0$ : $\log$ is not defined.

Consider:

$Y:= -y =$

$-x(3x+1)^{1/2}(x+1)^{1/2}$ for 3).

$Y\gt 0$ for $x$ in 3):

Take logs of $Y$ ,

carry through, and at the end revert to

$y' = -Y'$, the desired derivative.

Note: $x=0$ is excluded in the above manipulations.