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

  • Thread starter Thread starter Silva_physics
  • Start date Start date
  • Tags Tags
    Integration Modulus
Silva_physics
Messages
10
Reaction score
0
Hi! Could anybody, please, help me with integrate this: Integrate[ (|x| / x) dx]
Thank you:)
 
Mathematics news on Phys.org
You need to understand the function first. What is |x|/x for certain values of x? Think of the cases x>0, x<0, x=0.
 
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 \int_a^b |x|/x dx= -\int_a^b dx= -(b- a)= a- b.

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

If a< 0 and b> 0 then
\int_a^b |x|/x dx= -\int_a^0 dx+ \int_0^b dx= -(0- a)+ (b- 0)= a+ b.
 
oops … HallsofIvy is right :smile:
 
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!
 
  • #10
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, x/|x|^3= -1/x^2 and the integral is 1/x. If x> 0, x/|x|^3= 1/x^2 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
\left&lt;\frac{\partial U}{\partial x}, \frac{\partial U}{\partial y}, \frac{\partial U}{\partial z}\right&gt;= \left&lt;\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&gt;

And that's not terribly difficult.
To integrate
\frac{\partial U}{\partial x}= x(x^2+ y^2+ z^2}^{-3/2}
with respect to x, let W= x^2+ y^2+ z^2. Then, treating y and z as constants, dW= 2xdx and we have to integrate
\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)
(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:
(1/2)(x^2+ y^2+ z^2)^{-1/2}(2y)+ \phi_y= \frac{y}{\sqrt{x^2+ y^2+ z^2}}+ \phi_y

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