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!

  • $\begingroup$ I don't get you question. What is $h_n$? $\endgroup$ Aug 19, 2018 at 19:37
  • $\begingroup$ @Henrik Schumacher: $h_n$ is heaviside function! $\endgroup$ Aug 19, 2018 at 19:40
  • 1
    $\begingroup$ 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. $\endgroup$ Aug 19, 2018 at 19:42
  • $\begingroup$ @Henrik Schumacher: Okay, I'll do that! $\endgroup$ Aug 19, 2018 at 19:43
  • 1
    $\begingroup$ 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 $\endgroup$
    – Bill
    Aug 19, 2018 at 20:01

1 Answer 1


Why not use SquareWave instead?

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


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

enter image description here

The LaplaceTransform:

LaplaceTransform[f[t], t, s]



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.