Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can I use Mathematica to find the convolution $f*f$ for

f[t_]:=Piecewise[
        {{t*(Pi - 4*t + t^2), Inequality[0, Less, t, LessEqual, 1]}, 
         {(-t)*(2 + t^2 - 4*Sqrt[-1 + t^2] - 2*ArcCsc[t] + 2*ArcTan[Sqrt[-1 + t^2]]), 
           1 < t < Sqrt[2]
        }}, 0]

I would need a symbolic expression for the convolution. Thanks for any help.

share|improve this question
1  
Have you tried implementing the definition with NIntegrate ? –  b.gatessucks Jan 8 '13 at 8:28
add comment

1 Answer 1

Hard to do it analytically. Tried convolution theorem also. ForuierTransform had hard time with it as well as Integrate. So, here is a numerical solution.

The support needed is really only from $0$ to $2 \sqrt(2)$ since your function exist over $0$ to $\sqrt(2)$ but I integrated it over little larger range for the plot to look better.

Mathematica graphics

Hence

  f[t_?NumericQ] := 
  Piecewise[{{t*(Pi - 4*t + t^2), 
     Inequality[0, Less, t, LessEqual, 
      1]}, {(-t)*(2 + t^2 - 4*Sqrt[-1 + t^2] - 2*ArcCsc[t] + 
        2*ArcTan[Sqrt[-1 + t^2]]), 1 < t < Sqrt[2]}}, 0];
g[t_?NumericQ] := 
 NIntegrate[f[tao] f[t - tao], {tao, -Infinity, Infinity}]
data = Table[{t, g[t]}, {t, -0.5, 6, .01}];

Show[ListLinePlot[data, PlotStyle -> Red, PlotRange -> All], 
 Plot[f[t], {t, -.5, 6}, PlotRange -> All, Exclusions -> None]]

Mathematica graphics

The red plot is the convolution and the blue curve is $f(t)$

share|improve this answer
    
Why not integrating over -Infinity, Infinity ? NIntegrate handles that well. Also, in your plot you can remove the little gap by adding Exclusions->None. –  b.gatessucks Jan 8 '13 at 10:39
    
Just to make your g more generic. –  b.gatessucks Jan 8 '13 at 11:02
    
Nasser, thank you for your answer, but can you get a symbolic expression for the convolution? Thanks. –  selinia Jan 8 '13 at 15:13
2  
@selinia are you sure an analytical solution exists? –  rcollyer Jan 8 '13 at 18:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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