# Half range fourier cosine series

## Homework Statement

The function f(x) is defined on the interval 0<x<L by f(x)=x. It can be represented by the fourier cosine series

f(x) = a_0 + sum a_n cos(n*pi*x / L)

Find its Fourier coefficients a_0 and a_n.

## Homework Equations

Multiply both sides by cos(n*pi*x / L) and integrate from L to 0. Then integration by parts.

## The Attempt at a Solution

I got a_0 = L and a_n = 4L/ n^2 pi^2

The answers should be : a_0 = L/4 and a_n = -2L/n^2 pi^2 for n = odd and a_n=0 for n = even.

thanks!