# Derivatives involving the Absolute Value of Functions

1. Jun 10, 2014

### Cardinality

Problem:

y = ln|sec(x) + tan(x)|

Attempted Solution: See Attachment

I was hoping someone could identify my error and possibly write it out for me. At first I thought my steps were correct and everything was in order. However, when I checked my answer on WolframAlpha it gave me a slightly different result (actual answer is shown at the bottom of the attachment).

Thanks!

P.S: This was the source I consulted before attempting this:
It could be possible that there's another technique I'm not aware of to solve such questions.

#### Attached Files:

• ###### Derivative.jpg
File size:
16.2 KB
Views:
194
Last edited by a moderator: Sep 25, 2014
2. Jun 10, 2014

### jbunniii

You made an error when canceling $\sec(x) + \tan(x)$ in the numerator with $((\sec(x) + \tan(x))^2)^{1/2} = |\sec(x) + \tan(x)|$ in the denominator. Since $\sec(x) + \tan(x)$ is negative for some values of $x$, the two expressions are not the same.

Also note that $\sec(x)\tan(x) + \sec^2(x)$ can be simplified.

3. Jun 10, 2014

### Cardinality

I see my error! The numerator is now correct.
But I have two of these ((sec(x)+tan(x))2)1/2=|sec(x)+tan(x)| expressions in the denominator, and the answer has only one.
How would I go about handling this?

Last edited: Jun 10, 2014
4. Jun 10, 2014

### jbunniii

The answer you wrote at the bottom of the page is incorrect, and it also doesn't match what I get if I use Wolfram Alpha, so I'm not sure where you got that expression. Ignoring that answer for now, I assume you currently have:
$$\frac{(\sec x \tan x + \sec^2 x)(\sec x + \tan x)}{|\sec x + \tan x|^2}$$
Do you see how this can be simplified?

5. Jun 10, 2014

### Cardinality

Yes I have that answer exactly! (I simplified by factoring out the secx to get (secx)((secx + tanx)^2) in the numerator)
Sorry, I realized my input into WolframAlpha was incorrect. Thanks for your help!

6. Jun 10, 2014

### jbunniii

Here is the output that Wolfram Alpha gives:
$$\frac{\sec x(\sec x + \tan x)^2}{|\sec x + \tan x|^2}$$
But this is a case of WA being obtuse: clearly this can be reduced to a much simpler expression! Do you see why?

7. Jun 10, 2014

### Cardinality

Not sure, but I have two guesses:
a). What catches my eye first are the (secx + tanx)^2 in the numerator and denominator. But, I don't know anyway to simplify the expression further.
b). A possible trigonometric identity I don't see?

Haha, give me a hint! :P

8. Jun 11, 2014

### ehild

Is not a2=|a|2 for any a?

You overcomplicated the solution. Better to use the other definition of the absolute value: |a|=a if a≥0, |a|=-a if a<0.

ehild

9. Jun 11, 2014

### Ray Vickson

Recall that
$$\frac{d \ln|w|}{dw} = \frac{1}{w}$$
holds whether $w$ is positive or negative.

Last edited by a moderator: Sep 25, 2014
10. Jun 11, 2014

### Cardinality

So would I have two separate solutions? i.e: One for when the denominator is positive and the other for when it is negative, and then simplify from there?

Or is it something else?

Thanks! I have the absolute value in the denominator so far, I guess it serves as a general answer.
If what ehild said applies and I can have two separate answers (one for when the denominator is positive and the other for when it is negative), I should be able to simplify further!

11. Jun 11, 2014

### jbunniii

You don't have to go back and redo the problem another way unless you want to. The answer you have is fine, but you should simplify it:
$$\frac{\sec x(\sec x + \tan x)^2}{|\sec x + \tan x|^2}$$
Look at those two similar-looking expressions in the numerator and denominator. If $y$ is a real number, then what is the difference between $(y)^2$ and $|y|^2$?

12. Jun 11, 2014

### Ray Vickson

Sure, but that is exactly where the formula $d \ln|w| / dw = 1/w$ comes from; in other words, it has already been done, automatically.

13. Jun 11, 2014

### ehild

You have to get the derivative of the logarithm of the absolute value of a function y(x).

ln(|y|)= ln(y) if y>0, and the derivative is $\frac{d\ln(y)}{dx}= \frac{y'}{y}$
In case y<0, ln(|y|) = ln(-y), and the derivative is $\frac{d\ln(-y)}{dx}= -\frac{y'}{-y}=\frac{y'}{y}$

The derivative is the same both for y<0 and for y>0, as Ray told you...

The function y is $y=\sec(x)+\tan(x)=\frac{1+\sin(x)}{\cos(x)}$, and its derivative is $y'=\frac{1+\sin(x)}{\cos^2(x)}$ so y'/y=?

It is that simple.

ehild

14. Jun 11, 2014

### Cardinality

Ahh, I see it! Thank you...makes my method seem very tedious

So y'/y = 1/cos or sec :tongue:

15. Jun 11, 2014

### ehild

Yes, it is sec(x).

ehild

16. Jun 12, 2014

### jbunniii

Now that you have the answer, I'll elaborate on what I said in post #11:
$$\frac{\sec x(\sec x + \tan x)^2}{|\sec x + \tan x|^2}$$
Note that for any real $y$, we have $(y)^2 = |y|^2$ (the absolute values make no difference), so we can cancel the numerator and denominator to get $\sec(x)$.