lv = Piecewise[{{x h/a, x < a}, {h(x-λ)/(a-λ),x > a}}]

Plot[lv/.{a-> 1/2, λ-> 1, h-> 3},{x,0,1}]

EvenTerms3[n_,λ_] := (2/λ)(∫_0^a)x h/a Cos[2 Pi n x/λ] \[DifferentialD]x + (2/λ)(∫_a^λ)h(x-λ)/(a-λ) Cos[2 Pi n x/λ]\[DifferentialD]x

EvenTerms3[0,λ_] := (1/λ)(∫_0^a)x h/a  \[DifferentialD]x + (1/λ)(∫_a^λ)h(x-λ)/(a-λ) \[DifferentialD]x

(EvenTerms3[0,lam])/.{a->2, h-> 4, lam->6}

EvenTerms3[1, l]

et = EvenTerms3[i,lambda]

et0 = EvenTerms3[0,lambda]

OddTerms3[n_,λ_] := (2/λ)(∫_0^a) x h/a Sin[2 Pi n x/λ]  \[DifferentialD]x + (2/λ)(∫_a^λ)h(x-λ)/(a-λ) Sin[2 Pi n x/λ]\[DifferentialD]x

ot = OddTerms3[i,lambda]

(ot/.{i-> k, λ-> lambda,a-> aa, h-> hh})  Sin[k 2 Pi x/lambda]

et0

et0/.{i-> k, lambda-> λ,a-> aa, h-> hh}

fourRep[aa_, hh_, λ_, Nmax_] := 
(et0/.{i-> k, lambda-> λ,a-> aa, h-> hh})+
Sum[(ot/.{i-> k, lambda-> λ,a-> aa, h-> hh})  Sin[k 2 Pi x/λ],{k,1,Nmax}]+
Sum[(et/.{i-> k, lambda-> λ,a-> aa, h-> hh})  Cos[k 2 Pi x/λ],{k,1,Nmax}]

fourRep[2,4,6,12]

Plot[fourRep[2,4,6,23],{x,0,26}]

EvenAmplitudeVector3[NTerms_Integer,  λ_] :=
Table[EvenTerms3[i, λ]*Cos[i 2 Pi x/λ], {i,0,NTerms}]

OddAmplitudeVector3[NTerms_Integer, λ_] :=
Table[OddTerms3[i, λ]*Sin[i 2 Pi x/λ], {i,0,NTerms}]

ListPlot[EvenAmplitudeVector3[3,3]/.{a->2, h->1}]