Integral Problem

1. Jun 20, 2014

Rochefort

1. The problem statement, all variables and given/known data
$$1.31144371455535≈\int^{1}_{0}\sqrt{1+A^{2}\cos^{2}\left( x\right) }dx$$ Solve for $A$

2. Relevant equations

Also if it helps $$2.17363253251301≈\int^{2}_{0}\sqrt{1+\dfrac{A^{2}}{4}\cos^{2}\left( \dfrac {x}{2}\right) }dx$$

3. The attempt at a solution

I know that $A≈1$ for both equations but I don't know how to solve the equations without looking at the answers.

2. Jun 21, 2014

Saitama

Can you please post the exact problem statement? Are you supposed to solve the first integral using the second one or do you seek a closed form for the first one?

3. Jun 21, 2014

Simon Bridge

Have you been learning about special approximation methods recently?

4. Jun 21, 2014

SammyS

Staff Emeritus

5. Jun 21, 2014

Rochefort

No, I don't know what that is. This is a part of my own investigation and a method for solving this would help me progress.
I don't know the exact problem statement. All I can do is produce more equations of different values (on the LHS), for values of $A$. If you want, I can post more equations for when $A=1$ and you can solve the integral with the others. Also, it can be of closed form, it doesn't matter.
No it isn't.

Last edited: Jun 21, 2014
6. Jun 21, 2014

Simon Bridge

This is your own investigation and you don't have an exact problem statement?

In which case, your investigation has likely become derailed.

When you do your own investigating, you must be careful to properly phrase the problems or you will arrive at nonsense.

How are you getting the numbers on the LHS?
What are you trying to achieve?

The integrals you posted have exact forms involving elliptical integrals - which basically means you have to look them up. You expressed approximate forms so you could use an approximate method, like taking a power series of the integrand; or you could use a numerical method.

You treated the same sort of integral using a numerical method (Reimman sum) in your other two posts.

Last edited: Jun 21, 2014
7. Jun 21, 2014

Rochefort

Well I know that $$C=\int^{B}_{0}\sqrt {1+\dfrac {A^{2}}{B^{2}}\cos^{2}\left(\dfrac {x}{B}\right) }dx$$ And when provided with the values of $A$ and $B$ I can simulate results for $C$. What I did was, I converted it into a Riemann sum and produced an excel spreadsheet (consisting of exactly 1048574 rows per column) to output values of $C$ to 14 decimal places.
But I was wondering if I could find the value of $A$ when knowing the values of $B$ and $C$.

What I want to produce as a final result is the graph of $A$ versus $B$ for a set value of $C$.

8. Jun 21, 2014

Simon Bridge

Presumably you mean A to be squared in that expression?

So if you fix the value of C and B, you want to get A.
That's a bit clearer.

Use a Taylor series about B/2 ... use as many orders as you need.
The integration becomes trivial.

9. Jun 21, 2014

Rochefort

I have never used a Taylor series before so I don't know what you mean exactly. Here is my attempt so far:

So from knowing the power series representation of $\cos\left( x\right)$$$\cos^{2}\left( x\right) =1+\sum^{\infty }_{n=1}\dfrac {\left(-1\right)^{n}2^{2n-1}x^{2n}}{\left( 2n\right) !}$$ Therefore $$\cos^{2}\left( \dfrac{x}{B}\right) =1+\sum^{\infty }_{n=1}\dfrac {\left(-1\right)^{n}2^{2n-1}\left( \dfrac {x}{B}\right)^{2n}}{\left( 2n\right) !}$$ So$$1+\left(\dfrac {A}{B}\right)^{2}\cos^{2}\left(\dfrac {x}{B}\right)=1+\left(\dfrac{A}{B}\right)^{2}+\sum^{\infty}_{n=1}\dfrac{A^{2}\left(-1\right)^{n}2^{2n-1}x^{2n}}{\left( 2n\right) !B^{2n+2}}$$

$$C=\int^{B}_{0}\sqrt{1+\left(\dfrac{A}{B}\right)^{2}+\sum^{\infty}_{n=1}\dfrac{A^{2}\left(-1\right)^{n}2^{2n-1}x^{2n}}{\left(2n\right)!B^{2n+2}}}dx$$ Since I haven't used a Taylor series before I don't know what to do next, and at the moment, integration seems far from trivial. As I wait for a response I will try to investigate further but any input could really help clarify things.

10. Jun 21, 2014

Simon Bridge

Ideally you want the entire integrand to be represented by a Taylor series, then you will end up integrating a polynomial.
You know how to do that.

Take:$$f(x)=\sqrt{1+\frac{A^2}{B^2}\cos^2\left(\frac{x}{B}\right)} \approx \sum_{k=1}^n c_k(x-a)^k : c_k=\frac{f^{(k)}(a)}{k!}$$
... a is the "center" of the series, it is common to put a=0
... n is the "order of the approximation", it is very common to stop at n=1 or n=2, you can take the sum to infinity if you want... it's just that you have to evaluate the coefficients by hand.
... $f^{(k)}(a)$ is the kth derivative of f(x) wrt x evaluated at x=a.

You need the approximation to be close to the actual function only in the region you are integrating over. You do that by choosing a and n carefully. If you pick a=0 you may need a higher value of n, I have not checked.

11. Jun 21, 2014

Simon Bridge

Aside - you continue from here:
... by making an approximation.
The first order approximation would stop the sum at n=1 to give:

$$C \approx \int^{B}_{0}\sqrt{ 1+\dfrac{A^2}{B^2}- \dfrac{A^{2}}{B^{4}}x^2}dx$$ ... which is solvable by trig substitution.

12. Jun 21, 2014

Rochefort

Thank you so much. You have been so helpful!

13. Jun 21, 2014

Rochefort

One last question. How do I find which values of "a" and "n" are the most appropriate?

14. Jun 22, 2014

Simon Bridge

Trail and error ... mostly.

Try plotting f(x), and it's approximation, on the same axes... just fudge a value for A to start with.
You only need them to match up well-enough for your purpose ... since you are doing a definite integral, you don't need to worry about whether they match up outside the region of integration.

Since you've already done a numerical method for some integrals, you can use those values to guide you.
If you really need 14dp accuracy, you may find yourself having to do as high as n=10.
It ends up depending on what you want to use the results for.

I'd intuitively pick a=B/2 and n=2 since n=1 looks like it makes the integral come out negative.

15. Jun 23, 2014

Rochefort

I am finding it difficult to find a good approximation. I have tried different centers, "a" and different values for "A" and "B". Every time I get the summation up to the 6th order (when n=6) my computer screen freezes. Should I just assume "n" is a high value e.g. n=10? Could you suggest a way of graphing the summation without causing my computer to freeze?

16. Jun 23, 2014

pasmith

By substituting $y = x/B$ and using $\cos^2 y = 1 - \sin^2 y$, you can rewrite$$C=\int^{B}_{0}\sqrt {1+\dfrac {A^{2}}{B^{2}}\cos^{2}\left(\dfrac {x}{B}\right) }dx$$ as $$C = B \sqrt{1 + \frac{A^2}{B^2}} \int_0^1 \sqrt{1 - \frac{A^2}{A^2 + B^2}\sin^2 y}\,dy = \sqrt{A^2 + B^2} E\left(1,\frac{A}{\sqrt{A^2 + B^2}}\right)$$ where $E(\phi,k)$ is the incomplete elliptic integral of the second kind,$$E(\phi,k) = \int_0^\phi \sqrt{1 - k^2 \sin^2 y}\,dy.$$ This suggests that it would be easier to work with $k = A/\sqrt{A^2 + B^2}$ and $B$ rather than $A$ and $B$; you would then have $$C = \frac{B}{\sqrt{1 - k^2}} E(1,k),$$ and knowing $k$ you can recover $A$ using
$$A = \frac{Bk}{\sqrt{1 - k^2}}.$$
You can expand $\sqrt{1 - k^2 \sin^2 y}$ as a binomial series in $k^2 \sin^2y$, which can be integrated term by term (since the integral of $\sin^{2n} y$ is known) to end up with a polynomial in $k^2$; but you're still going to have to solve for $k$ numerically.

It would thus seem necessary to use a root-finding algorithm to solve $$\frac{B}{\sqrt{1 - k^2}} E(1,k) - C = 0$$ for $k$ and to integrate numerically (or, if possible, use a library function to evaluate $E(1,k)$) at each step of that algorithm.

Last edited: Jun 23, 2014
17. Jun 23, 2014

Rochefort

Also I don't think you can solve for "A"

18. Jun 23, 2014

Rochefort

@pasmith:

That is way beyond my understanding (at the moment.) Could you provide more steps/explanation to your method. Also if n=10 for $$C=\int^{B}_{0}\sqrt{1+\left(\dfrac{A}{B}\right)^{2}+\sum^{n}_{k=1} \dfrac{A^{2}\left(-1\right)^{k}2^{2k-1}x^{2k}}{\left(2k\right)!B^{2k+2}}}dx$$ could you show me how to solve for "A" using trigonometric substitution.

19. Jun 25, 2014

Simon Bridge

The bottom line is that you have set yourself a non-trivial task requiring some fairly advanced maths.
You'll have to experiment a bit to learn how to do it. You can look up "elliptical functions" online.

To get your computer to handle the tougher calculations, you need to use a program other than a spreadsheet.
Do the computation in stages.

You'll have to decide how good an answer you want and how badly you want it.
It looks to me like you are trying to solve a problem the hard way.

20. Jun 25, 2014

Rochefort

Sorry, accidentally posted via my phone, my question is bellow.