Series expanding from integral?

759 Views Asked by At

I have a specific question with regards to an integral like this one, for example: $\int(x^6)cos(3x)dx$

I noticed that this solves out to: $= (x^6)(\frac{1}{3}\sin(3x) ) - (6x^5)(-\frac{1}{9}\cos(3x) ) $ ....... (it goes on a while)

As I'm a student who (admittedly) failed Calculus II the first time and am retaking it and using your notes to practice, I wanted to challenge myself to writing a general series for solving all problems of the type:

$$\int (x^a)\cos(b*x)dx$$ where:

  • a is a real integer constant
  • b is a real constant
  • a > 0

so, from the previous problem: a=6, b=3

I understand that this series would start with sum(n=1, a) but I don't know where to go from there.

I also have a few questions about how I would go about doing this:

  • How do I alternate between cos and sin? For example: $\cos(...) + \sin(...) + \cos(...) + \sin(...) ...$
  • This series seems to start at n=6 and count downwards towards $n=1$. How do I work around this problem, as (as far as I'm aware) series need to count up?
  • More broadly, beyond this series thing, is there any other way of simplifying the work required in a problem like this, where: $\int(x^{\text{some power}} * \cos(...) dx)$ So that I won't have to go through the process of integrating by parts every little thing into the table, and then putting it all together, since that's super time intensive and I my biggest problem last semester was not doing my math quick enough?

I also understand that I might have to write a different counterpart series for any integral like $\int(x^a)\sin(b*x) dx$

Final note: I'm aware that there's such a thing as "series expansion of an integral" but I don't know anything about it, as we haven't covered it in class yet. I understand that if I followed those methods, I could probably do this no problem, but I wanted to challenge myself for the sake of practice.


EDIT:

So now that I've worked on it for a little bit, I've broken it into parts a little more:

  • alternate sin/cos: $$\sum_{n=0}^a\frac{(-1)^n(x^{2n}+(-\frac{\pi}{2}+x)^{2n})}{(2n)!}$$ which I figured out from extensively playing around with desmos and the equations

  • alternate + or -: $$(-1)^n $$

  • the first term: So the first term, going from the end of the integral $(720)(-(1/2187) \sin(3y))$ forward, should therefore be $720$. $720$ in this case is $6!$, so I can describe this in my series as $a!$.

However I've gotten stuck here. For all terms after $n=0$, there is a pattern of $\frac{a!}{n!}$ but at $n=0$, I can't do that. Is there a way I can keep this pattern, but make it so that when n=0, that denominator becomes $1$, as it is?

So basically this would work if:

$\frac{720}{0} = 720$, $\frac{720}{1} = 720$, $\frac{720}{2} = 360$, $\frac{720}{6} = 120...$

so I need that 0 there to act like a $1$. How would I do this?

  • second term: for the second term, I can say: $$-\frac{1}{b^{a+1-n}}(...)$$ where (...) is the alternating sin(bx) or cos(bx). I wonder if putting that entire sum from above in here would actually work though, or if I'd have to figure it out more there.

So I need more help with the "first term" section and possibly with the "second term" section. Thank you!


EDIT #2:

So here's what I have: $$\sum_{n=0}^{a}(-1)^n(\frac{a!}{n!}x^n)((-\frac{1}{b^{a+1-n}})(\frac{(-1)^n((bx)^{2n}+(-\frac{\pi}{2}+(bx))^{2n})}{(2n)!})) $$

Okay so it's clunky and not at all elegant, but that's okay. But most importantly, it doesn't work. The terms do not come out to $(720)(-1/2187\sin(3x)) - (720x)(-1/729\cos(3x)) +.... + (x^6)(1/3\sin(3x))$ as they should.

So what did I do wrong here? How can I fix it so that it works?

3

There are 3 best solutions below

0
On BEST ANSWER

When you have to perform integration by parts multiple times, here is a method to keep yourself organized.

$\begin {array}{} D&I\\ x^a&\cos bx\\ ax^{a-1} & \frac 1b \sin bx\\ a(a-1)x^{a-2} & -\frac 1{b^2} \cos bx\\ a(a-1)(a-2)x^{a-3} & -\frac 1{b^3} \sin bx\\ \vdots&\vdots\\ \end{array}$

In the first column, we are repeatedly differentiating. The next column and repeatedly integrating.

Since $a$ is an integer, eventually we get down to a constant in column 1. (Or a zero one more row below)

Multiply the expressions in column 1 by the expression in the row below for column 2.

$\begin {array}{} \frac 1b x^{a}\sin bx\\ -\frac a{b^2} x^{a-1} \cos bx\\ -\frac {a(a-1)}{b^3} x^{a-2}\sin bx\\ \vdots&\vdots\\ \end{array}$

And finally add the odd rows and subtract the even rows.

$\frac 1b x^{a}\sin bx + \frac a{b^2} x^{a-1} \cos bx -\frac {a(a-1)}{b^3} x^{a-2}\sin bx + \cdots$

$\sum_\limits{k=0}^\frac {a-1}{2} (-1)^{k} \frac {a!}{(a-2k)!b^{2k+1}}x^{a-2k}\sin bx +(-1)^k\frac {a!}{(a-2k-1)!b^{2k+2}}x^{a-2k-1}\cos bx$

(This assumes a is odd. If a is even, you will need to chop off one term)

2
On

Here is a start (integration-by-parts $k$ times):

$$\begin{align} \int x^k \cos bx \, dx = \frac{1}{b} \int x^k \frac{d}{dx} (\sin bx) \, dx &= \frac{1}{b} \left[x^k \sin b x - k \int x^{k-1}\sin bx \, dx \right]\\ &= \frac{1}{b} \left[x^k \sin b x + \frac{k}{b} \int x^{k-1}\frac{d}{dx} (\cos bx) \, dx \right]\\ &= \frac{1}{b} \left\{x^k \sin b x + \frac{k}{b} \left[x^{k-1} \cos b x - (k-1) \int x^{k-2} \cos bx \, dx \right] \right\}\\ & \vdots \end{align}$$

The integral involving $\sin bx$ will follow the same pattern (essentially the rightmost integral on the first line).

Hope it's okay to switch from $a$ to $k$ in the notation. The symbol $k$ is often used for integers.

UPDATE

Okay, once you actually integrate each type ( cosine and sine) by parts once, you can use the formulas found to solve any problem of the same form. Just apply the formula over and over to reduce the exponent at each step. You don't have to think about integrating-by-parts each time.

2
On

Very good question, I think. These complicated integrals plague engineering students quite often. An elementary but not simple way to calculate integration of $x^a\cos(bx)$ form is using integration by parts.(and induction?)

First. If you know $\int x^{a-1}\cos bxdx$ then you can calculate $\int x^a\sin bxdx$, and if you know $\int x^{a-1}\sin bxdx$ then you can calculate $\int x^a\cos bxdx$. See below and note that no count-up occurs.

$$ \begin{matrix} \int x^a\cos bxdx&=&\int x^a\frac d{dx}\left(\frac1b\sin bx\right)dx\\ &=&\frac{1}b\left[x^a\sin bx-\int\frac d{dx}(x^a)\sin bxdx\right]\\ &=&\frac 1bx^a\sin bx-\frac ab\int x^{a-1}\sin bxdx \end{matrix} $$

and similiar way to calculate $\int x^a\sin bxdx$.

Second. There are no general way to calculate if $a$ is not non-negative integer in my head. But improper integral could be calculated if $a$ is complex number with $\Re a>-1$ with some Laplace transform.

Laplace transform of $t^a$ is well-known and could be easily verified.

$$ \int_0^\infty x^a e^{ibx}dx=\left.\int_0^\infty t^ae^{-st}dt\right|_{s=-ib}=\mathcal L\{t^a\}(s=-ib)=\left.\frac{\Gamma(a+1)}{s^{a+1}}\right|_{s=-ib}=\frac{i^{a+1}\Gamma(a+1)}{b^{a+1}} $$

and

$$ \int_0^\infty x^a\cos bxdx=\Re\left(\int_0^\infty x^a e^{ibx}dx\right),\,\,\,\,\int_0^\infty x^a \sin bxdx=\Im\left(\int_0^\infty x^a e^{ibx}dx\right) $$

holds.


EDIT I've forgotten that my favourite method calculating integral like this. This method has the disadvantage of losing rigor, but I like it because it's so simple.

We can predict that the integral of $x^a\cos bx$ will be $p(x)\cos bx+q(x)\sin bx$ for some polynomial and their degree should be not bigger than $a+1$(this prediction is a big part of the loss of rigor), and then $x^a\cos bx=\frac{d}{dx}p(x)\cos bx+q(x)\sin bx=(p'(x)+bq(x))\cos bx+(q'(x)-bp(x))\sin bx$.

Then system of differential equation borns, and it can be solved by comparing coefficients.

$$\left\{\begin{matrix}p'(x)+bq(x)=x^a\\q'(x)-bp(x)=0\end{matrix}\right.$$

It loss its power when $a$ is not positive integer or $a$ is very large, but it is useful when $a<10$, maybe.