1

The equation is:

$$1 = \int_{0}^{a} \sqrt{0.158\sin^2t +0.307} dt$$

Given the above equation, how would I be able to find the value of $a$? I have tried converting the integral into a symbolic antiderivative (which is what was advised by my teacher), however, I don't think there is a way to simplify this.

I think I would be able to find the value of $a$ with brute force code, where it tries multiple values of $a$ until it reaches the correct value, however, I need to perform this calculation many times, so I would prefer not to take this approach.

Divide1918
  • 2,093
  • Could you provide a bit more context? The constants such as 0.158 look particularly curious, where did the problem come from? – Divide1918 Jan 19 '24 at 17:35
  • This integral has no closed form solution (although it may be expressed as some kind of elliptic function), so numerics are the only option. To make the numerical search more efficient, you could try a bisection method or something like Newton's method if you have a decent initial guess for $a$. – whpowell96 Jan 19 '24 at 17:36
  • @Divide1918 I was trying to approximate the orbits of planets which I treat as ellipses into 2 sinusoids. The parametric equation of Mercury is (0.307cos(t), 0.465sin(t)) (in AU). I use the principles of simple harmonic motion to try to create 2 sinusoids which model distances from the x and y axis. The 0.158 comes from $sqrt(0.465sin^2t+0.307cos^2t$, which I simplify to get the above equation. I am using the above integral to find the interval between points which I will plot to hopefully create a sinusoid. – Licheng Zheng Jan 19 '24 at 18:06
  • 1
    Try $$a = 1.6098987602286736$$ Found using numerical integration and root finding. – Moo Jan 19 '24 at 18:07
  • @Moo Could you explain to me how you got a? (is there an algorithm?) or did you just brute force it? – Licheng Zheng Jan 19 '24 at 18:10
  • @LichengZheng: Yes, it is two algorithms - I used a combination of Newton's Method with Composite Simpson's Rule from https://math.stackexchange.com/questions/737964/approximations-newtons-method-composite-simpsons-rule – Moo Jan 19 '24 at 18:21
  • @Moo could you please show me how you used these algorithms to solve my problem? I am having a lot of difficulty following what they did in the link you provided – Licheng Zheng Jan 19 '24 at 18:34
  • Ok thank you so much! – Licheng Zheng Jan 19 '24 at 19:40
  • Good question. Without equipment I think one must give great effort to find $a$ approximately. – Bob Dobbs Jan 19 '24 at 21:07
  • 1
    For general: $1=\int_0^a \sqrt{A \sin ^2(x)+B} , dx$ then: $\frac{1}{\sqrt{B}}=E\left(a\left|-\frac{A}{B}\right.\right)$ to solve $a$ we need a numericall methods. Where : $E\left(a\left|-\frac{A}{B}\right.\right)$ is elliptic integral of the second kind. – Mariusz Iwaniuk Jan 20 '24 at 17:55

1 Answers1

2

I will use this MSE post as a guide.

We are asked to find the value of $x$ (changed $a$ to $x$ so I can reuse post details) where:

$$ \int_{0}^{x} \sqrt{0.158\sin^2t +0.307} dt= 1$$

We need two numerical approaches here. One to find the zeros of the function $f(t)$, Newton's Method, and one to estimate the integral, Composite Simpson and Composite Trapezoidal, above where:

$$f(x) = \int_{0}^{x} \sqrt{0.158\sin^2t +0.307} dt - 1 = 0$$

The derivative wrt $x$ of this function is

$$f'(x) = \sqrt{0.158\sin^2x +0.307}$$

The Newton-Raphson method is given by:

$$\displaystyle x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)} = x_n - \dfrac{\displaystyle \int_{0}^{x_n} \sqrt{0.158\sin^2t +0.307}~ dt - 1} {\sqrt{0.158\sin^2x_n +0.307}}$$

At each iteration, we have to use the Composite Simpson's Rule to find the value of that integral for the next $x_n$.

$$s = \int_a^b f(x) \approx \dfrac{h}{3} \left( f(a) + f(b) + 4 \sum_{i=1}^{n/2}~f(a + (2i - 1)h)+2 \sum_{i=1}^{(n-2)/2} f(a+2 ih) \right)$$

The initial starting point is $x_0 = 0.5$ with a desired accuracy of $10^{-5}$.

The iterations are:

  • $x_0 = 0.5$

  • Using Composite Simpson, with $n=4$: $s$ evaluated between $(0, 0.5)$ gives $s = 0.28259$

  • Using Newton's iteration: $x_1 = x_0 - \dfrac{f(x_0)}{f'(x_0)} = 0.5 - \dfrac{0.28259 - 1}{0.585932} = 1.72439$

  • $s$ evaluated between $(0, 1.72439)$ gives $s = ...$

  • $x_2 = ...$

  • $s = ...$

  • $x_3 = ...$

  • $s = ...$

  • Please fill in the details

  • Final result is $x_n = 1.6098987602286736$

This means $$a = 1.6098987602286736$$

It is easy to verify that that value satisfies your integral relation using Wolfram Alpha.

Repeat this exact same procedure using the Composite Trapezoidal Rule for calculating the values of $s$ to make sure you understand.

Update

We can find a non-elementary solution to the integral as (where E is the complete elliptic integral)

$$\frac{1}{10} \sqrt{\frac{307}{10}} \left(2 E\left(-\frac{158}{307}\right) \text{IntegerPart}\left[\frac{a}{\pi }\right]+E\left(\pi~~ \text{FractionalPart}\left(\frac{a}{\pi }\right)|-\frac{158}{307}\right)\right)$$

I was hoping to be able to use a numerical method to find the root, but do not see how.

I then used Mathematica's FindInstance command on the "closed-form" solution to find $$a = 1.60989876022843878114724442347$$

Moo
  • 11,311
  • 1
    That is my favorite approximation method. Newton-Raphson. +1 – Bob Dobbs Jan 20 '24 at 08:15
  • @BobDobbs: Me too, thanks. I am trying to figure out if there is a way to create a similar problem that requires the use of four different numerical methods. – Moo Jan 20 '24 at 10:33