I am stuck with this integral: $$\int_{0}^{L}\frac{1}{a+bx}\cos(\frac{i\pi x}{L})^2dx$$

which is one term of the stiffness matrix of a conical shell. I thought about expanding $\cos(cx)^2/(a + bx)$ in Taylor series around zero, which will do the following:

$$\frac{\cos(cx)^2}{a+bx}=\frac{1}{a+\text{bx}}-\frac{c^2 x^2}{a+\text{bx}}+\frac{c^4 x^4}{3 (a+\text{bx})}-\frac{\left(2 c^6\right) x^6}{45 (a+\text{bx})}+\frac{c^8 x^8}{315 (a+\text{bx})}-\frac{\left(2 c^{10}\right) x^{10}}{14175 (a+\text{bx})}+O\left(x^{11}\right)$$

Making the integral solvable up to the desired precision.

The question is, is there a better way to perform this integration?


Well you can put it like this:

$$ \begin{eqnarray} \int_{0}^{L}\frac{\cos(\frac{i\pi x}{L})^2}{a+bx}dx&=&\frac{1}{4}\int_{0}^{L}\frac{\left(e^{i\frac{i\pi x}{L}}+e^{-i\frac{i\pi x}{L}}\right)^2}{a+bx}dx=\\ &=&\frac{1}{4}\int_{0}^{L}\frac{e^{\frac{2\pi x}{L}}}{a+bx}dx+\frac{1}{4}\int_{0}^{L}\frac{e^{-\frac{2\pi x}{L}}}{a+bx}dx+\frac{1}{4}\int_{0}^{L}\frac{2}{a+bx}dx=\\ &=&\frac{e^{-\frac{2 \pi a}{b L}} \left(\text{Ei}\left(2 \left(\frac{a}{b L}+1\right) \pi \right)-\text{Ei}\left(\frac{2 a \pi }{b L}\right)\right)}{b}+\\ &+&\frac{e^{\frac{2 \pi a}{b L}} \left(\text{Ei}\left(-\frac{2 (a+b L) \pi }{b L}\right)-\text{Ei}\left(-\frac{2 a \pi }{b L}\right)\right)}{b}+\frac{\log(1+\frac{b L}{a})}{b} \end{eqnarray} $$ which is valid if $\left(a\neq 0\land b\neq 0\land L\neq 0\land \Re{(\frac{a}{b L})}\geq 0\right)\lor \Re{(\frac{a}{b L})}<-1\lor \frac{a}{b L}\notin \mathbb{R}$

  • $\begingroup$ thank you... I will have look at this approach. The problem was the $Ei$ function created at the end... $\endgroup$ – Saullo G. P. Castro Sep 25 '13 at 8:02
  • $\begingroup$ @SaulloCastro and what's the problem? That's the standard exponential integral, which is defined in most math packs. $\endgroup$ – Caran-d'Ache Sep 25 '13 at 8:04
  • $\begingroup$ The problem is that after integrating I transfer the resulting expression to a Cython routine, where $Ei$ should be translated in terms of another known function, preferably a function which is available in C... $\endgroup$ – Saullo G. P. Castro Sep 25 '13 at 8:10
  • 1
    $\begingroup$ @SaulloCastro Do you mean something like this? $\endgroup$ – Caran-d'Ache Sep 25 '13 at 8:15
  • $\begingroup$ deeply dug up! Thank you! $\endgroup$ – Saullo G. P. Castro Sep 25 '13 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.