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?
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)