How to solve this integral?
Show older comments
I need to solve this integral.

In practice, Phi(x) is a discrete set o values. How to proceed? Any ideas?
7 Comments
Walter Roberson
on 29 Oct 2017
I am not sure what you are saying about discrete values. Is the point just that phi(x) is not continuous? Is it mostly non-zero except a few points? Is it piecewise continuous ?
There is no hope of a closed form solution without a formula for phi(x) .
Leonardo Miquelutti
on 29 Oct 2017
Walter Roberson
on 29 Oct 2017
Your original question mentioned Phi(x) not Phi(omega), and the formula shows x as being the argument.
If what you wrote as Phi(x) is really Phi(omega), and so is constant in x, then your integral has no solution because of the division by 0 at the point x = omega .
Leonardo Miquelutti
on 29 Oct 2017
Walter Roberson
on 29 Oct 2017
Each integration is with a fixed ω. If Φ(x) does not involve x then the integral does not converge.
David Goodmanson
on 29 Oct 2017
Hi Leonardo,
Could you state clearly what the integrand is? Not counting the constant in front, is it
x.*( pi/4 - phi(omega) ) ./ (x.^2-omega.^2)
or
x.*( pi/4 - phi(x) ) ./ (x.^2-omega.^2) as the equation says
or ??
The notation indicates a principal value integral, so the integration past the pole at x = omega is actually all right.
In the equation the limits for x are 0 and infinity, and it's the behavior of the integrand as x --> infinity that tells the tale. In the first case ( pi/4 - phi(theta) ) is a constant function of x as Walter mentioned, and the integral diverges because the integrand ~~1/x for large x. No good.
In the second case the integral will converge if
( pi/4 - phi(x) ) --> 0 as x--> infinity,
(assuming phi(x) is otherwise a well-behaved function) because the integand goes to zero faster than 1/x as x --> infinity.
Leonardo Miquelutti
on 30 Oct 2017
Answers (1)
David Goodmanson
on 31 Oct 2017
Hi Leonardo,
You can do the integral in the following way.
Let [p/4 - phi(x)] = u(x) where u(x) --> 0 as x --> inf.
Not counting the 4/pi in front,
I = Int{0,inf} u(x)*x/(x^2-w^2) dx
Use the identity
x/(x^2-w^2) = (1/2)*(1/(x-w) + 1/(x+w))
to create sum of four integrals
Ia = Int{0,w-eps} (1/2)u(x)/(x-w) dx eps --> 0
Ib = Int{w-eps,w+eps} (1/2)u(x)/(x-w) dx eps --> 0
Ic = Int{w+eps,inf} (1/2)u(x)/(x-w) dx eps --> 0
Id = Int{0,inf} (1/2)u(x)/(x+w) dx
The integral Id has no singularities and is not a problem. You can make eps smaller and smaller until Ia and Ic settle down, ignore Ib, sum the other three and you are done (except you can add a correction term mentioned below). eps might be something like 1e-4*w.
This works because, after making the variable change x = y+w then
Ib = Int{-eps,eps} (1/2) u(y+w)/y dy
As eps gets small, u is closer and closer to being a constant u(w) in the interval. Now use the fact that for the principal value
p.v. Int(y1,y2) (1/y) dy = log(|y2|/|y1|)
Here y1 and y2 can be on the same side of the singularity or opposite sides, doesn't matter. In Ib, if u is constant you get
Ib = u(k) (1/2) log(|eps|/|eps|) = 0
so it goes away. Going back to variable x, u(x) is probably going to have a nonzero slope at x = w and it is easy to come up with a correction term for Ib which is
Ib = (1/2)(u(w+eps) - u(w-eps))
and that gets added to the sum.
If phi(x) is an algebraic function defined for any x then you can use the 'integral' function, but if phi(x) comes from data then the integral might have to be done differently.
Categories
Find more on Code Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!