% Laplace-type convolution
% In this file we will convolve sin(3*t) with itself.
% However, it is easy to compute other convolution products
% by changing f and g

clear
syms t s u


% Enter f(t) and g(t)
f=sin(3*t); 
g=f;

% For this problem the convolution is h=f/9-t*cos(3*t)/3;

% Prepare the function for f*g = int_0^t f(u)*g(t-u) du
f2=subs(f,t,u); 
g2=subs(g,t,t-u);

% Compute the convolution f*g:
fg=int(f2*g2,u,[0 t]); 

% Verify the Convolution Theorem 
% Print F and G
[simplify(laplace(f)), simplify(laplace(g))]

% Print FG and L[f*g]
[simplify(laplace(f)*laplace(g)), simplify(laplace(fg))]