I have a piece-wise function:
$f(t) = \begin{Bmatrix} t & 0 < t < 1\\ \frac{(4-t)}{3} & 1 < t < 4 \end{Bmatrix}$
which has period of $4$.
In my attempt to find the coefficients, I found $A_0$ to be $1/2$.
I'm having trouble finding $A_n$. I'm using
$\omega = \frac{\pi }{2}$
as
$\omega = \frac{2\pi }{T}$ and trying to solve
$$\frac{A_{n}}{2} = \frac{1}{4} \int_{0}^{1} t\cdot \cos(n\omega t ) dt + \frac{1}{4}\int_{1}^{4} \frac{4-t}{3} \cdot \cos(n \omega t) dt$$
I keep getting an answer that is different from the solution for $n = 1$, $A_n =-.270$
I'm not sure if I am approaching this problem incorrectly, as I have tried solving it using an integral calculator after multiple attempts and I still am getting the wrong answer. Other online resources that I've looked at use a slightly different equation to solve for An, but that is the equation from my textbook.
Any help would be greatly appreciated.