# Numberical integration method

1. Nov 28, 2014

### samgrace

1. The problem statement, all variables and given/known data

Integreate:

$T = ∫ \frac{dy}{V_ab (y)} = \frac{2}{v}∫[1 + \frac{\alpha^2 y}{L} + 2\alpha \sqrt\frac{y}{L} cos(\phi(y))]^\frac{-1}{2} dy$

where $\phi (y) = \frac{\pi}{6} + sin^-1(\frac{\alpha\sqrt{y}}{2\sqrt{L}})$

The limits are between 0 and L

2. Relevant equations

3. The attempt at a solution
I have input this integral several times into matlab with no success, I was wondering if there was a way to do this on paper? My module on numerical integration isn't until next term

Last edited: Nov 28, 2014
2. Nov 28, 2014

### Zondrina

Are you familiar with a function known as $\text{quad()}$? It uses Simpson quadrature to numerically estimate the integral.

There is also $\text{quadl()}$, which uses Lobatto quadrature.

The quad/quadl syntax you should be using is: $\text{quad(function, a, b)}$.

So define your integral as an anonymous function between the respective limits from $a$ to $b$ and quad should return the answer.

3. Nov 28, 2014

### Ray Vickson

You can use the fact that
$$\cos(\phi) =\frac{\sqrt{3}}{4} \sqrt{4 - \frac{\alpha^2 y}{L}}- \frac{\alpha}{4} \sqrt{\frac{y}{L}}$$
then change variables to $y/L = w^2$ to get
$$T = \frac{2}{v} 4L \int_0^1 \frac{w}{\sqrt{D(w)}} \, dw, \\ D(w) = 4 + 2 \alpha^2 w^2 + 2 \sqrt{3} \alpha w \sqrt{4 - \alpha^2 w^2}$$
A further change of variables to $w = (2/\alpha) \sin(\theta)$, followed by $\theta = \lambda/2$ produces
$$T = \frac{2}{v} \frac{2L}{\alpha^2} \int_{\lambda =0}^{2\arcsin(\alpha/2)} \frac{\sin(\lambda)}{2 - \cos(\lambda) -\sqrt{3} \sin(\lambda)}\, d \lambda$$
This last integral still might not be doable explicitly, but it contains a single parameter $r = 2 \arcsin(\alpha/2)$, so can be tabulated as a numerical function of $r$ (and perhaps even be "fitted" by a simple functional form in $r$ that has adequate accuracy over the $r$-range of interest to you).

Note added in edit: by some further manipulations, the integral can be done in terms of standard functions. I really cannot tell you more until you supply evidence of having struggled with the problem, by showing your work, etc.

Last edited: Nov 28, 2014