Derivatives involving the Absolute Value of Functions

Cardinality
Messages
17
Reaction score
0
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.
 

Attachments

  • Derivative.jpg
    Derivative.jpg
    16.2 KB · Views: 662
Last edited by a moderator:
Physics news on Phys.org
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.
 
jbunniii said:
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.

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:
Cardinality said:
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?
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?
 
jbunniii said:
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?

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!
 
Cardinality said:
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!
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?
 
jbunniii said:
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?

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
 
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
 
Cardinality said:
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.


Recall that
\frac{d \ln|w|}{dw} = \frac{1}{w}
holds whether ##w## is positive or negative.
 
Last edited by a moderator:
  • #10
ehild said:
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

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?

Ray Vickson said:
Recall that
\frac{d \ln|w|}{dw} = \frac{1}{w}
holds whether ##w## is positive or negative.

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
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
Cardinality said:
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!

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
Cardinality said:
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?

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
ehild said:
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

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

So y'/y = 1/cos or sec :-p
 
  • #15
Cardinality said:
Ahh, I see it! Thank you...makes my method seem very tedious

So y'/y = 1/cos or sec :-p

Yes, it is sec(x).

ehild:smile:
 
  • #16
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)##.
 
  • Like
Likes 1 person
Back
Top