my code till now is:
clear all
clc
syms x t
f=sin(x);
g=cos(x);
N=10;
n=1:N;
l=10;
landa_n=(n*pi)/l;
for n=1:N
a_n(n)=(2/l)*int(f*sin(n*pi*x/l),0,l);
b_n(n)=(2/landa_n*l)*int(g*sin(n*pi*x/l),0,l);
end
a=a_n;
b=b_n;
f_new=0;
for n=1:N
f_new=f_new+((a*cos(landa_n*t)+b*sin(landa_n*t))*sin(n*pi/l));
end
plot(x,t,f_new)