# Plot the graph of the square wave function defined as $f(t)=\sum^{\infty}_{n=0}(-1)^n h_{n}(t)$ on the interval $t>0$ and find its Laplace transform

Plot the graph of the square wave function defined as $$f(t)=\sum^{\infty}_{n=0}(-1)^n h_{n}(t)$$ on the interval $t>0$ and find its Laplace transform. The http://mathworld.wolfram.com/FourierSeriesSquareWave.html has FourierSeriesSquareWave but not exactly as the function above. Please, can anyone help out in plotting this graph and solving the problem? Thanks for your time and help!

• I don't get you question. What is $h_n$? – Henrik Schumacher Aug 19 '18 at 19:37
• @Henrik Schumacher: $h_n$ is heaviside function! – Omojola Micheal Aug 19 '18 at 19:40
• Oha. There is more then one Heaviside function? Really, poorly stated questions have a low chance to be answered properly. Please provide all relevant information. – Henrik Schumacher Aug 19 '18 at 19:42
• @Henrik Schumacher: Okay, I'll do that! – Omojola Micheal Aug 19 '18 at 19:43
• Is this f = Sum[(-1)^n*HeavisideTheta[t - n], {n, 0, 10}] g = LaplaceTransform[f, t, s] Plot[f, {t, 0, 10}] Plot[g, { s, 0, 10}] close to what you are looking for? Note: make sure each of those four expressions is on a separate line or in a separate cell in your notebook – Bill Aug 19 '18 at 20:01

Why not use SquareWave instead?

f[t_] := SquareWave[t/2]


Visualization:

Plot[f[t], {t, 0, 10}]


LaplaceTransform[f[t], t, s]


Tanh[s/2]/s