# Antiderivative help

1. Dec 8, 2004

### Manchot

Well, I'm working on a project, but I've run into a bit of a snag: an antiderivative that I need to evaluate, but can't. Even Mathematica's stuck on this one. :) Here it is:

$$\int \frac{dx}{2+cos(ax)-cos(\frac{b}{x})}$$

Any help would be appreciated, even if a numerical approximation is all that can be found (actually, that would probably be most useful). BTW, a and b are constants. Thanks a bunch!

2. Dec 8, 2004

### dextercioby

The antiderivative u're looking for doesn't exist.It's as simple as that.Just because "x" appears in the denominator of the cosine's argument.
Thefore,a numerical evaluation would be the solution,but even here i'm having serious doubts it can easily be done.If u specify limits of integration,and represent the function graphically,then a computer software could give an approximation.

Daniel.

3. Dec 8, 2004

### Manchot

Well, here's the problem. Part of my project involves making a computer program. I'd like to figure out how to approximate it without outside programs. Is it possible to express the integral in terms of other, "impossible" integrals, like Mathematica's CosIntegral?

4. Dec 8, 2004

### dextercioby

No.As i said,it could be done only numerically.
Cosine integral is not an impossible integral,it's something described thoroughly here

BOOKMARK that page !!!Very useful.Abramowitz&Stegun online.Free,no more butt moving to the library.

5. Dec 8, 2004

### Hurkyl

Staff Emeritus
*sigh* you have an integral with some nasty features.

poor behavior when |x| is small, due to the cos b/x.

poor behavior when cos ax is near -1 and cos b/x is near 1. (division by near zero) In particular, this crops up periodically whenever |x| is large.

However, you -might- have a nice in-between area where the function is well-behaved, and a simple numerical approximation (e.g. Simpson's rule!) would be feasible.

I think a good approach for |x| small is this:
(a) If 0 is included in the domain of integration (or near-zero numbers are), set a threshhold below which you assume the integrand is zero. If this threshhold is small enough, it won't affect the value of the integral much. (Look for an upper bound on the integrand!)

(b) If |x| is small, but above the threshhold, you can find upper and lower bounds on cos ax. Replace cos ax with these bounds then try the substitution x = 1/y. The resulting integral might be managable with simple numerical methods.

(c) If |x| is large, then cos b/x is very nearly one. You can find an upper and lower bound on it that yields a very narrow range. When you replace cos b/x with these bounds (thus bounding the actual integrand), the resulting integrand does have an antiderivative. (Though it will be different for the upper and lower bound!)

(d) If |x| is somewhere inbetween, you can probably get good results with a simple numerical method. Try and make sure that you don't get near-0 division anywhere in the domain of integration, though.

6. Dec 8, 2004

### Manchot

So, there's no clever formula which approximates it, simply because of the x in the denominator of the Cosine function? I find that hard to believe, because according to Mathematica,

$$\int \cos(\frac{1}{x}) dx = x cos(\frac{1}{x}) + Si(\frac{1}{x})$$

Did you misspeak when you said that that was the reason for its non-existence? Perhaps you meant "because the cos with 1/x in it is in the denominator?" Or did I misinterpret you?

7. Dec 8, 2004

### Manchot

Thanks for the help, Hurkyl. My limits of integration are mostly in the well-behaved regions (x>2). However, there may or may not be an asymptote in between the limits. Actually, that's what I'm (as in the computer program) is trying to find out. I want the program to be able to quickly determine whether or not the asymptote is between the limits, and I noticed that for some equations which are always positive and have asymptotes (like 1/x^2), if you try to use to find an integral over a single asymptote using the fundamental theorem of calculus, you'll get a negative result (which obviously doesn't make sense). I wanted to see if this was true for my function as well.

If it turned out to be true, the computer program should be able to determine the asymptote using the bisection method. In case you hadn't guessed it by now, I'm trying to find numerical methods of finding an algorithm to find a specific bracketed root of 2+cos(ax)-cos(bx), using something similar to the bisection method. (The analytic answers are too trivial and don't tell me enough, but I know that a numerical one would. Unfortunately, Newton's method doesn't always converge, and I can't use the secant method or bisection method directly since the function never actually dips below the axis). Any suggestions?

Last edited: Dec 8, 2004
8. Dec 8, 2004

### dextercioby

According to me:
$$\int \cos(\frac{1}{x}) dx =x cos(\frac{1}{x}) -\int \frac{1}{x}\sin(\frac{1}{x}) dx =x cos(\frac{1}{x}) +\int x\sin(\frac{1}{x}) d(\frac{1}{x}) = x cos(\frac{1}{x}) +Si(x)$$

Just checking,i don't trust computer sofware too much...
QUOTE(moi):"The antiderivative u're looking for doesn't exist.It's as simple as that.Just because "x" appears in the denominator of the cosine's argument.".

What's wrong there???

9. Dec 9, 2004

### Hurkyl

Staff Emeritus
Is there something wrong with solving the simultaneous equations:
cos ax = -1
cos bx = 1
?

10. Dec 9, 2004

### Manchot

Yes, there is. Earlier, I used the phrase "trivial" to describe it. However, that wasn't the correct word. I meant that it is impractical. Each equation has an infinite solution set, and the intersections of those sets are the roots of the equation, true. Unfortunately, to find that intersection would entail checking to see whether each member of the one solution set is a member of the other: a guess and check algorithm, which isn't very efficient. I'd like a more sophisticated way of doing it, if you know what I mean.

Heh heh...Usually I think of analytic solutions as the most sophisticated way of doing something. Now I'm considering a numerical way of doing it to be better.

11. Dec 9, 2004

### StatusX

well simultaneous solutions of cos(ax) = 1 and cos(bx) = -1 are easy to find. a/b must be rational, and I think either the denominator or the numerator is even. even if im wrong about that, there definitely a way to generate all the solutions to those equations analytically. but if you really mean cos(b/x), as your first post suggests, then numerical solutions are probably the only way.

Last edited: Dec 9, 2004
12. Dec 9, 2004

### Hurkyl

Staff Emeritus
Not really -- one just has to exhaust over a finite number of solutions.

Notice that all but finitely many solutions to cos ax = 1 lie in a range where cos b/x cannot be -1, and all but finitely many solutions to cos b/x = -1 lie in a range where cos ax cannot be 1.

13. Dec 9, 2004

### Manchot

Ok, I was thinking, and I had another idea. Is there a function with the same asymptotes as my original one, but which is anti-differentiable? I was trying to find one, but found the search difficult. Any ideas?

14. Dec 10, 2004

### Manchot

See, the problem is that I've been having trouble moving the cos(b/x) term out of the denominator. I figure that if I can do that, I'll be in business.