# Any idea how can I solve this integral?

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have to integrate this function: (Ln[(1+x)/(1-x)]+2*x^(1/3))/(x+2*Sin[x]) in the interval [0 1]. One way it to use Simpson's rule but there will be a division by 0 (obviously). Any ideas what to do?? [Edited by - NamelessTwo on March 29, 2005 11:26:52 AM]

##### Share on other sites

Do you need the antiderivative of the function or only the value of the integral?

##### Share on other sites
well, here is a very cool link. BTW, you might want to put an extra open-parens on the front of the equation you posted.

##### Share on other sites
((Log[1+x]/(1-x))+(2*x^1/3))/(x+2*Sin[x]) if you're gonna use above website

rating++ for lonesock for posting it :)

##### Share on other sites
Parentesis now should match. I've doublechecked them.

All I need is the value...

...but the antiderivative function would be nice too :) (for curiosity reasons).

(x^1/3 is cube root of x)

for me the main problem is the interval [0 1] if the interval is something like: [0.1 0.6] the value is: 0.40

[Edited by - NamelessTwo on March 29, 2005 11:54:56 AM]

##### Share on other sites
The problem is not the division at x = 0. For x near zero, your integrand looks like 2*x^{-2/3}, in which case your function is integrable near zero. The problem is at x = 1. For x near 1, your integrand looks like (Log(2)/(1-x)+2)/(1+Sin(1)). The term 1/(1-x) is not integrable near one since the antiderivative is -Log(1-x). The definite integral is infinite.

Generally, if you have a function F(x) defined on (a,b] and you need to compute the definite integral Integral(a,b;F(x)), and if the definite integral exists, you need to partition the domain into (a,a+e) and [a+e,b] for some small number e > 0. A numerical integrator is used to compute Integral(a+e,b;F(x)). The function F(x) is approximated by a function G(x) that has had the singularity at x = a removed, and you numerically compute Integral(a,a+e;G(x)).

For example, if F(x) = 2*x^{1/3}/(x+2*sin(x)) for 0 < x <= 1, then for x nearly zero, sin(x) is approximated by x. The function G(x) = 2*x^{1/3}/(x+2*x) = 2*x^{-2/3}/3. The choice of e for the partition into (0,e) and [e,1] will affect the error. The smaller the value of e, the better G(x) approximates F(x). However, the smaller the value of e, the larger the probability that the numerical integrator will have problems on [e,1]. You have to strike a good balance...

##### Share on other sites
Quote:
 Original post by FrunyHow does that relate to game programming?

Improper integrals can show up in physical simulations. For example, the equations of motion for a simple pendulum without friction may be manipulated to an expression that specifies the period of motion in terms of an improper integral. The period of the motion is then estimated by numerically computing the improper integral using the general method I proposed. The OP did not say that the origin of his question was a physics problem, but who knows.

##### Share on other sites
Dave, thank you for your explanation :) Now I need to understand it.

BTW the integrator (from the link) produces this: (2*x^(1/2)+log[1+x]/(1-x))/x+2*sin[x])

Fruny,

Quote:
 How does that relate to game programming?

That's numerical math, which I haven't studied carefully at the university. It's about real stuff :) (like games)

##### Share on other sites
Thread closing immediately. This has every indication of being schoolwork. I know the original poster said later that it isn't, but still didn't offer a satisfactory explanation for the reason for the post.

Folks, I'd appreciate it if you would all go and read the Forum FAQ, for review or for the first time. If a post resembles schoolwork (such as a math statement involving integration or evaluation of an arbitrary equation), then the policy here requires some justification and description, along with some evidence that the poster has tried to solve the problem for him/herself.

##### Share on other sites

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

This topic is now closed to further replies.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631435
• Total Posts
3000056
×