obtain the fourier series expansion of f(x) = 1+x if -2<x<0 ; f(x) = 1-x if 0<x<2

Last time I did anything like was over 60 years ago.

Found this video that almost parallels your problem, (I had difficulty understanding
him, perhaps that is why they have subtitles)

https://www.google.ca/search?rlz=1C6CHFA_enCA690CA691&sxsrf=ALeKk00pcGpMsTZFud1k9gLG2mAxwA07Ag%3A1584971926465&source=hp&ei=lsB4XoLzGPK1gge5qKX4BA&q=fourier+series+expansion&oq=fourier+series+expansion&gs_l=psy-ab.3..0l10.2404.2404..2786...2.0..0.78.78.1......0....2j1..gws-wiz.....10..35i362i39.8jmHAy3SNl0&ved=0ahUKEwiClpzF4LDoAhXymuAKHTlUCU8Q4dUDCAY&uact=5#kpvalbx=_msB4XpqKJcHctQbCtou4DA68

You can check your work at any of a number of online FS calculators, such as the one at

www.symbolab.com/solver/fourier-series-calculator

To obtain the Fourier series expansion of the function f(x), we need to find the coefficients of the cosine and sine terms in the series representation. The Fourier series for f(x) is given by:

f(x) = a₀/2 + Σ [aₙ * cos(nωx) + bₙ * sin(nωx)]

where a₀/2 is the average value of f(x), aₙ and bₙ are the Fourier coefficients, n is the harmonic number, and ω is the angular frequency.

Let's find the Fourier coefficients for the given function f(x) = 1+x for -2 < x < 0 and f(x) = 1-x for 0 < x < 2.

Step 1: Find the average value a₀/2 of f(x):
To find the average value a₀/2, we can evaluate the function f(x) over one period and take the average.

a₀/2 = (1/2) * ∫[0 to 2] (f(x)) dx
= (1/2) * ∫[0 to 2] (1-x) dx (using f(x) = 1-x for 0 < x < 2)
= (1/2) * [x - (x²/2)] | [0 to 2]
= 1 - 2²/4
= 1 - 1
= 0

So, the average value a₀/2 of f(x) is 0.

Step 2: Find the coefficients aₙ and bₙ for the cosine and sine terms:
To find the coefficients aₙ and bₙ, we can use the formula:

aₙ = (1/π) * ∫[0 to 2π] (f(x) * cos(nωx)) dx
bₙ = (1/π) * ∫[0 to 2π] (f(x) * sin(nωx)) dx

where ω = 2π/T is the angular frequency, and T is the period of the function.

In our case, the function f(x) has a period of 2, so T = 2, and ω = 2π/2 = π.

Now we can calculate the coefficients aₙ and bₙ.

aₙ = (1/π) * ∫[0 to 2] (f(x) * cos(nπx/2)) dx (using ω = π)
bₙ = (1/π) * ∫[0 to 2] (f(x) * sin(nπx/2)) dx (using ω = π)

For -2 < x < 0, f(x) = 1+x:
aₙ = (1/π) * ∫[-2 to 0] ((1+x) * cos(nπx/2)) dx
= (1/π) * [∫[-2 to 0] cos(nπx/2) dx + ∫[-2 to 0] x * cos(nπx/2) dx]

We need to evaluate these integrals for n = 0, 1, 2, 3, and so on, using integration techniques.

For example, let's calculate a₀ (n = 0) and a₁ (n = 1).

For a₀ (n = 0):
a₀ = (1/π) * ∫[-2 to 0] 1 dx
= (1/π) * [x] | [-2 to 0]
= (1/π) * [0 - (-2)]
= 2/π

For a₁ (n = 1):
a₁ = (1/π) * ∫[-2 to 0] (1+x) * cos(πx/2) dx
= (1/π) * [∫[-2 to 0] cos(πx/2) dx + ∫[-2 to 0] x * cos(πx/2) dx]

Similarly, you can calculate the rest of the coefficients aₙ and bₙ for different values of n.

Once you have the coefficients aₙ and bₙ, you can substitute them in the Fourier series formula to get the final series representation for f(x).