Re: a question about the UnitStep function

• To: mathgroup at smc.vnet.net
• Subject: [mg58424] Re: [mg58411] a question about the UnitStep function
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Sat, 2 Jul 2005 04:06:22 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```f[x_]:=(UnitStep[x+1]-UnitStep[x-1])/2;

integrand=f[z] f[x-z];

A workaround is to use finite but "large" limits on the integral

g[x_]=Assuming[Element[x,Reals],
Integrate[integrand,{z,-10,10}]]

(1/4)*((-(x + 2))*UnitStep[-x - 2] - (x - 2)*UnitStep[2 - x] + 2*x*UnitStep[-x])

g[x]//Simplify

Piecewise[{{(2 - x)/4, Inequality[0, Less, x, LessEqual, 2]}, {(x + 2)/4,
Inequality[-2, Less, x, LessEqual, 0]}}]

Plot[g[x],{x,-4,4},PlotRange->All];

Bob Hanlon

>
> From: Zhou Jiang <jiangzhou_yz at yahoo.com>
To: mathgroup at smc.vnet.net
> Date: 2005/07/01 Fri AM 02:02:03 EDT
> Subject: [mg58424] [mg58411] a question about the UnitStep function
>
>
> Dear Mathgroup,
> I want to let Mathematica compute the convolution of two sqare waves. I
did as follows
>
> f[x_]:=(UnitStep[x+1]-UnitStep[x-1])/2;
>
> integrand=f[z] f[x-z];
>
> Assuming[Element[x, Reals], Integrate[integrand, {z, -Infinity, Infinity}]]
>
> Mathematica gave me the result as follows,
> ((-1 + x) UnitStep[-1 + x] - x UnitStep[x] + (2 + x) UnitStep[2 + x])/4
>
> I plot the result to check
>
> Plot[%,{x,-10,10}, PlotRange->All];
>
> It is clear wrong since the convolution of two square waves should be
convergent. Can anyone give me some help with the subtlties about the
UnitStep function? Any thoughts are appriciable.
>
>
>

```

• Prev by Date: Re: a question about the UnitStep function
• Next by Date: Re: Can't assign value to symbols