Quit

Plot[(x^2) (1-x),{x,0,1},PlotRange->0.2]

2 Integrate[(x^2) (1-x) Sin[n π x],{x,0,1}]

((2 (-2 n π-4 n π (((-1))^n)+(6-(n^2) (π^2)) 0))/((n^4) (π^4)))

((2 (-2-4 (((-1))^n)))/((n^3) (π^3)))

2Integrate[(x^2) (1-x) Sin[n π x],{x,0,1}]
c[n_]=FullSimplify[%,{n∈Integers}]

d[n_]=0

u[t_,x_]=Sum[c[n] Cos[n π t] Sin[n π x],{n,1,∞}];

Manipulate[Plot[u[t,x],{x,0,1},PlotRange->0.2],{t,0,1}]

frame[t_]:=Plot[u[t,x],{x,0,1},PlotRange->0.2]

frame[1]

Δt=0.1;     (*  intervalo de tempo entre frames  *)
fps=(1/(Δt));  (*  frames por segundo  *)

tab=Monitor[Table[Show[frame[t]],{t,0,10,Δt}],t];

ListAnimate[tab,fps,AnimationRunning->False]

Export["corda.gif",tab,"DisplayDurations"->(1/fps),AnimationRepetitions->∞,ImageSize->300]

Quit

g[x_]=Piecewise[{{4 x,x<(1/4)},{2-4 x,(1/4)<x<(1/2)},{0,x>(1/2)}}]

Plot[g[x],{x,0,1}]

(2/(π n))Integrate[g[x] Sin[n π x],{x,0,1}]

d[n_]=FullSimplify[%,{n∈Integers}]

u[t_,x_]=Sum[d[n] Sin[n π t] Sin[n π x],{n,1,100}];

Manipulate[Plot[u[t,x],{x,0,1},PlotRange->0.2],{t,0,1}]

frame[t_]:=Plot[u[t,x],{x,0,1},PlotRange->0.2]

frame[.2]

Δt=0.1;     (*  intervalo de tempo entre frames  *)
fps=(1/(Δt));  (*  frames por segundo  *)

tab=Monitor[Table[Show[frame[t]],{t,0,10,Δt}],t];

ListAnimate[tab,fps,AnimationRunning->False]

Export["corda2.gif",tab,"DisplayDurations"->(1/fps),AnimationRepetitions->∞,ImageSize->300]