4
$\begingroup$

I calculated the derivative of $\left|\frac{x+1}{x+2}\right|$ in the same way that I would do with $ \frac{x+1}{x+2}$ in order to study the function.

But when I verified on wolfram, I noticed it is all wrong. Wolfram uses the chain rule as you can see here.

I don't get it. The only rule I've been taught as far as absolute function derivatives are concerned, is $|x|' = \frac{x}{|x|}$. Does a similar rule apply for $f(x)$? And why does wolfram uses chain rule?


Edit

I calculated the derivatives as there is no absolute and then, at the result, I applied the absolute.

My answers are $|(\frac{x+1}{x+2})|' = |(\frac{x+1}{x+2})'| = \frac{1}{\left(x+2\right)^2}$ and $|(\frac{x+1}{x+2})|'' = |(\frac{x+1}{x+2})''| = \frac{2}{\left(x+2\right)^3}$

Wolfram's answer is

$\left(\left|\frac{x+1}{x+2}\right|\right)'\:=\frac{\left|x+2\right|\left(x+1\right)}{\left|x+1\right|\left(x+2\right)^3}$


$\endgroup$
3
  • 1
    $\begingroup$ What answer did you get? It's easier to answer "why use the chain rule" if we can point out exactly where you went wrong. $\endgroup$ Aug 25, 2020 at 6:58
  • $\begingroup$ We can't guess what you did, so we can't tell where "it is all wrong". $\endgroup$
    – user65203
    Aug 25, 2020 at 7:02
  • $\begingroup$ I edited the question $\endgroup$ Aug 25, 2020 at 7:04

3 Answers 3

3
$\begingroup$

This is how I deal with absolute functions:

$$ \begin{align} \left|\frac{x+1}{x+2}\right|&=\sqrt{\left(\frac{x+1}{x+2}\right)^{2}}\\ \\ \frac{d}{dx} \left|\frac{x+1}{x+2}\right|&=\frac{d}{dx} \sqrt{\left(\frac{x+1}{x+2}\right)^{2}}\\ &=\frac{1}{2 \sqrt{\left(\frac{x+1}{x+2}\right)^{2}}}\cdot 2 \left(\frac{x+1}{x+2}\right)\cdot\frac{1}{\left(x+2\right)^{2}}\\ &=\frac{x+1}{\left(x+2\right)^{3}\cdot\left|\frac{x+1}{x+2}\right|} \end{align} $$

Notice the chain rule when I differentiate the square root

$\endgroup$
5
  • $\begingroup$ Great, thank you! $\endgroup$ Aug 25, 2020 at 7:14
  • $\begingroup$ The term $\left(\frac{1}{x+2}\right)^{2}$ would be better writen as $\frac{1}{\left(x+2\right)^{2}}$ – it's the denominator which gets squared in differentating a ratio. The numerator reduces to $1$ and $1$ squared equals $1$, so the equality holds whith $1^2$, but there's no reason to introduce squaring to numerator. $\endgroup$
    – CiaPan
    Aug 25, 2020 at 8:27
  • $\begingroup$ @CiaPan that is spot on! Edited it, thanks. $\endgroup$ Aug 25, 2020 at 8:35
  • 1
    $\begingroup$ @RezhaAdrianTanuharja goodness, thank you so much for that original approach, it will be really useful to me!! :)) $\endgroup$ Aug 25, 2020 at 8:42
  • 1
    $\begingroup$ @A-levelStudent ur welcome mate $\endgroup$ Aug 25, 2020 at 9:55
1
$\begingroup$

As an alternative, using sign function we have that for $x\neq -1,-2$

$$\left|\frac{x+1}{x+2}\right|=\frac{x+1}{x+2}\cdot \frac{\left|\frac{x+1}{x+2}\right|}{\frac{x+1}{x+2}}=\frac{x+1}{x+2} \operatorname{sign}\left(\frac{x+1}{x+2}\right)$$

therefore by chain rule, since $(\operatorname{sign}(x))'=0 $ for $x\neq 0$, we obtain

$$\frac d{dx}\left|\frac{x+1}{x+2}\right|=\left(\frac d{dx}\frac{x+1}{x+2}\right)\operatorname{sign}\left(\frac{x+1}{x+2}\right)=\frac1{(x+2)^2}\operatorname{sign}\left(\frac{x+1}{x+2}\right)=\frac{\left|\frac{x+1}{x+2}\right|}{(x+1)(x+2)}$$

which is an equivalent form for the derivative.

$\endgroup$
2
  • $\begingroup$ That was really nice! $\endgroup$ Aug 28, 2020 at 7:24
  • 1
    $\begingroup$ You are welcome! Bye $\endgroup$
    – user
    Aug 28, 2020 at 7:27
1
$\begingroup$

Hint:

As

$$\left|\frac{x+1}{x+2}\right|=\pm\frac{x+1}{x+2},$$

it is legitimate to take the derivative of the fraction without the absolute value.

Instead of an absolute value, you will use a piecewise definition where the sign is adjusted in every interval, and the derivatives naturally follow.

$\endgroup$
10
  • $\begingroup$ Altough it seems right to me, I think it comes in contrast with the result Wolfram suggested i.e $\left(\left|\frac{x+1}{x+2}\right|\right)'\:=\frac{\left|x+2\right|\left(x+1\right)}{\left|x+1\right|\left(x+2\right)^3}$ $\endgroup$ Aug 25, 2020 at 7:06
  • $\begingroup$ @Euler: how can you tell that these answers differ ? $\endgroup$
    – user65203
    Aug 25, 2020 at 7:07
  • 1
    $\begingroup$ @Euler: I don't think that you learnt from this case. :-( $\endgroup$
    – user65203
    Aug 25, 2020 at 7:21
  • 1
    $\begingroup$ @Euler: instantiate $\pm$ accordingly. $\endgroup$
    – user65203
    Aug 28, 2020 at 7:51
  • 1
    $\begingroup$ @Euler: yes, you get it ! I am adding a comment about this. $\endgroup$
    – user65203
    Aug 28, 2020 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .