Appendix C
Integral Expressions for the Triangle Wave Example
This appendix solves two integral expressions for the triangle wave example:
- \(\displaystyle\frac{4A}{T^2} \left( \color{red}{\int\limits_0^{T/2} t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {\ -\ } \color{green}{\int\limits_{-T/2}^0 t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {}\right)\)
- \(\displaystyle\frac{4A}{T^2} \left( \color{red}{\int\limits_0^{T/2} t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {\ -\ } \color{green}{\int\limits_{-T/2}^0 t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {}\right)\)
The integral of type \(\displaystyle\int t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt\) or \(\displaystyle\int t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt\) can be solved using the integration by parts method.
Integration by parts reminder
The product rule (or Leibniz rule) is a formula used to find the derivatives of products of two or more functions:
\[(f(x)g(x))' = f'(x)g(x) + f(x)g'(x)\]
Integrate both parts:
\[\int \left((f(x)g(x))'\right)dx = \int \left(f'(x)g(x) + f(x)g'(x)\right)dx\]
\[f(x)g(x) = \int f'(x)g(x)dx + \int f(x)g'(x)dx\]
\[\int f(x)g'(x)dx = f(x)g(x) - \int f'(x)g(x)dx\]
Let’s make a couple of substitutions:
- \(u = f(x)\), \(du = f'(x)dx\)
- \(v = g(x)\), \(dv = g'(x)dx\)
This results in the integration by parts formula:
\[\int u\,dv = uv - \int v\,du\]
For a definite integral:
\[\int_a^b u\,dv = \left[ uv \right]_a^b - \int_a^b v\,du\]
Solving \(\displaystyle\int t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt\)
Let:
- \(u = t\), \(dv = \cos\left(\dfrac{2\pi m}{T} t\right)dt\)
- \(du = dt\), \(v = \dfrac{T}{2\pi m} \sin\left(\dfrac{2\pi m}{T} t\right)\)
\[\displaystyle\int\limits_a^b t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt = \int\limits_a^b u\,dv\]
Using \(\displaystyle\int\limits_a^b u\,dv = \left[uv\right]_a^b - \int\limits_a^b v\,du\), we find:
\[\displaystyle\int\limits_a^b t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt = \left[ t \cdot \frac{T}{2\pi m} \sin\left(\frac{2\pi m}{T} t\right) \right]_a^b - \frac{T}{2\pi m} \int\limits_a^b \sin\left(\frac{2\pi m}{T} t\right)dt\]
\[= \left[ t \cdot \frac{T}{2\pi m} \sin\left(\frac{2\pi m}{T} t\right) \right]_a^b + \frac{T}{2\pi m} \left[ \frac{T}{2\pi m} \cos\left(\frac{2\pi m}{T} t\right) \right]_a^b\]
\[= \frac{T}{2\pi m} \left[ t \cdot \sin\left(\frac{2\pi m}{T} t\right) \right]_a^b + \left(\frac{T}{2\pi m}\right)^2 \left[ \cos\left(\frac{2\pi m}{T} t\right) \right]_a^b\]
First Integral Term:
\[\color{red}{\displaystyle\int\limits_0^{T/2} t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt = \frac{T}{2\pi m} \left[ t \cdot \sin\left(\frac{2\pi m}{T} t\right) \right]_0^{T/2} + \left(\frac{T}{2\pi m}\right)^2 \left[ \cos\left(\frac{2\pi m}{T} t\right) \right]_0^{T/2}}\]
\[\color{red}{= \frac{T}{2\pi m} \left(\frac{T}{2} \sin(\pi m) - 0\right) + \left(\frac{T}{2\pi m}\right)^2 \left(\cos(\pi m) - \cos(0)\right)}\]
Since \(\sin(\pi m) = 0\):
\[\color{red}{= \left(\frac{T}{2\pi m}\right)^2 \left(\cos(\pi m) - 1\right)}\]
Second Integral Term:
\[\color{green}{\displaystyle\int\limits_{-T/2}^0 t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt = \frac{T}{2\pi m} \left[ t \cdot \sin\left(\frac{2\pi m}{T} t\right) \right]_{-T/2}^0 + \left(\frac{T}{2\pi m}\right)^2 \left[ \cos\left(\frac{2\pi m}{T} t\right) \right]_{-T/2}^0}\]
\[\color{green}{= \frac{T}{2\pi m} \left(0 + \frac{T}{2} \sin(-\pi m)\right) + \left(\frac{T}{2\pi m}\right)^2 \left(\cos(0) - \cos(-\pi m)\right)}\]
Since \(\sin(-\pi m) = 0\) and \(\cos(-\pi m) = \cos(\pi m)\):
\[\color{green}{= \left(\frac{T}{2\pi m}\right)^2 \left(1 - \cos(\pi m)\right)}\]
Combined Expression:
\[\frac{4A}{T^2} \left( \color{red}{\int\limits_0^{T/2} t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {\ +\ } \color{green}{\int\limits_{-T/2}^0 t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {}\right)\]
\[= \frac{4A}{T^2} \left( \color{red}{\left(\frac{T}{2\pi m}\right)^2 (\cos(\pi m) - 1)} \color{#222832} {\ -\ } \color{green}{\left(\frac{T}{2\pi m}\right)^2 (1 - \cos(\pi m))}\color{#222832} {} \right)\]
\[= \frac{2A}{(\pi m)^2} (\cos(\pi m) - 1)\]
Solving \(\displaystyle\int t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt\)
Let:
- \(u = t\), \(dv = \sin\left(\dfrac{2\pi m}{T} t\right)dt\)
- \(du = dt\), \(v = -\dfrac{T}{2\pi m} \cos\left(\dfrac{2\pi m}{T} t\right)\)
\[\displaystyle\int\limits_a^b t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt = \int\limits_a^b u\,dv\]
Using \(\displaystyle\int\limits_a^b u\,dv = \left[uv\right]_a^b - \int\limits_a^b v\,du\), we find:
\[\displaystyle\int\limits_a^b t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt = \left[ -t \cdot \frac{T}{2\pi m} \cos\left(\frac{2\pi m}{T} t\right) \right]_a^b + \frac{T}{2\pi m} \int\limits_a^b \cos\left(\frac{2\pi m}{T} t\right)dt\]
\[= \left[ -t \cdot \frac{T}{2\pi m} \cos\left(\frac{2\pi m}{T} t\right) \right]_a^b + \frac{T}{2\pi m} \left[ \frac{T}{2\pi m} \sin\left(\frac{2\pi m}{T} t\right) \right]_a^b\]
\[= -\frac{T}{2\pi m} \left[ t \cdot \cos\left(\frac{2\pi m}{T} t\right) \right]_a^b + \left(\frac{T}{2\pi m}\right)^2 \left[ \sin\left(\frac{2\pi m}{T} t\right) \right]_a^b\]
First Integral Term:
\[\color{red}{\displaystyle\int\limits_0^{T/2} t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt = -\frac{T}{2\pi m} \left[ t \cdot \cos\left(\frac{2\pi m}{T} t\right) \right]_0^{T/2} + \left(\frac{T}{2\pi m}\right)^2 \left[ \sin\left(\frac{2\pi m}{T} t\right) \right]_0^{T/2}}\]
\[\color{red}{= -\frac{T}{2\pi m} \left(\frac{T}{2} \cos(\pi m) - 0\right) + \left(\frac{T}{2\pi m}\right)^2 \left(\sin(\pi m) - \sin(0)\right)}\]
\[\color{red}{= -\frac{T^2}{4\pi m} \cos(\pi m)}\]
Second Integral Term:
\[\color{green}{\displaystyle\int\limits_{-T/2}^0 t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt = -\frac{T}{2\pi m} \left[ t \cdot \cos\left(\frac{2\pi m}{T} t\right) \right]_{-T/2}^0 + \left(\frac{T}{2\pi m}\right)^2 \left[ \sin\left(\frac{2\pi m}{T} t\right) \right]_{-T/2}^0}\]
\[= \color{green}{\frac{T}{2\pi m} \left(0 - \frac{T}{2} \cos(-\pi m)\right) + \left(\frac{T}{2\pi m}\right)^2 \left(\sin(0) - \sin(-\pi m)\right)}\]
\[= \color{green}{-\frac{T^2}{4\pi m} \cos(\pi m)}\]
Combined Expression:
\[\frac{4A}{T^2} \left( \color{red}{\int\limits_0^{T/2} t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {\ -\ } \color{green}{\int\limits_{-T/2}^0 t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {} \right)\]
\[= \frac{4A}{T^2} \left( \color{red}{ -\left(\frac{T}{2\pi m}\right)^2 \cos(\pi m)} \color{#222832} {\ +\ } \color{green}{\left(\frac{T}{2\pi m}\right)^2 \cos(\pi m)} \color{#222832} {}\right) = 0\]
Final Results:
- \(\displaystyle \frac{4A}{T^2} \left( \color{red}{\int\limits_0^{T/2} t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {\ -\ } \color{green}{\int\limits_{-T/2}^0 t \cdot \cos\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {} \right) = \frac{2A}{(\pi m)^2} \left(\cos(\pi m) - 1 \right) \)
- \(\displaystyle \frac{4A}{T^2} \left( \color{red}{\int\limits_0^{T/2} t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {\ -\ } \color{green}{\int\limits_{-T/2}^0 t \cdot \sin\left(\frac{2\pi m}{T} t\right)dt} \color{#222832} {} \right) = 0\)