How Do You Integrate the Function |x|/x?

  • Context: Undergrad 
  • Thread starter Thread starter Silva_physics
  • Start date Start date
  • Tags Tags
    Integration Modulus
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
9 replies · 14K views
Silva_physics
Messages
10
Reaction score
0
Hi! Could anybody, please, help me with integrate this: Integrate[ (|x| / x) dx]
Thank you:)
 
Physics news on Phys.org
Ok, thanks, I thought about it, so in the cases x>0,x<0 it is 1 and in x=0 it is 0, that's all?
 
Welcome to PF!

Hiho Silva! Welcome to PF! :smile:
Silva_physics said:
Ok, thanks, I thought about it, so in the cases x>0,x<0 it is 1 and in x=0 it is 0, that's all?

Yup! :biggrin:

(except that at 0 it's undefined … though that won't affect the integration)
 
Oh, Thanks:) I feel here like at home:D
 
Silva_physics said:
Ok, thanks, I thought about it, so in the cases x>0,x<0 it is 1 and in x=0 it is 0, that's all?
NO! For x> 0 |x|/x= x/x= 1 but for x< 0, |x|/x= -x/x= -1. At x= 0 it is undefined.


If both a and b are less than 0 then [itex]\int_a^b |x|/x dx= -\int_a^b dx= -(b- a)= a- b[/itex].

If both a and b are larger than 0 then [itex]\int_a^b|x|/x dx= \int_a^b dx= b- a[/itex].

If a< 0 and b> 0 then
[tex]\int_a^b |x|/x dx= -\int_a^0 dx+ \int_0^b dx= -(0- a)+ (b- 0)= a+ b[/tex].
 
Thanks a lot for the great answers!:)
 
I have a very similar problem and can’t seem to work it out! Ok, here goes:

X/|X|^3 =grad U(X)​

which, when integrated gives

U(X)=- 1/|X|​

But I can’t seem to integrate to get the correct answer. Also, if

U(X)=- 1/|X|^v​

where v is a constant, then what is grad U(X) now? Thanks for reading and any help will be much appreciated!
 
Are we to assume that X is a single real number and "grad" is just the derivative?

If that is the case, the, for x< 0, [itex]x/|x|^3= -1/x^2[/itex] and the integral is 1/x. If x> 0, [itex]x/|x|^3= 1/x^2[/itex] and the integral is -1/x.

If, however, X is the vector <x, y, z>, then the problem is not at all the same!
You are looking for a function U(x,y,z) such that
[tex]\left<\frac{\partial U}{\partial x}, \frac{\partial U}{\partial y}, \frac{\partial U}{\partial z}\right>= \left<\frac{x}{(x^2+ y^2+ z^2)^{3/2}}, \frac{y}{(x^2+ y^2+ z^2)^{3/2}}, \frac{z}{(x^2+ y^2+ z^2)^{3/2}}\right>[/tex]

And that's not terribly difficult.
To integrate
[tex]\frac{\partial U}{\partial x}= x(x^2+ y^2+ z^2}^{-3/2}[/tex]
with respect to x, let [itex]W= x^2+ y^2+ z^2[/itex]. Then, treating y and z as constants, dW= 2xdx and we have to integrate
[tex]\frac{1}{2}\int W^{-3/2}dW= -W^{-1/2}+ \phi(y,z)= -(x^2+ y^2+ z^2)^{-1/2}+ \phi(y,z)[/tex]
(Since the integration is done treating y and z as constant, the "constant of integration" may depend on y and z.)

Now, differentiate that with respect to y:
[tex](1/2)(x^2+ y^2+ z^2)^{-1/2}(2y)+ \phi_y= \frac{y}{\sqrt{x^2+ y^2+ z^2}}+ \phi_y[/tex]

Comparing that with the gradient, we see that [itex]\phi_y= 0[/itex] and so does not depend on y. Doing the same with z shows that [itex]\phi_z= 0[/itex] also and so it reallyis a constant.
 
Last edited by a moderator: