% Erzeugung von plots fuer den Beweis von Jacksons Theorem

% Beispielfunktion
f = @(x) exp(sin(5*x.*x));
t = linspace(0,1,1000);
tp = linspace(-4,4,1000);

figure;
h = plot(t,f(t),'r-',tp,f(cos(tp)),'b-',[0 0],[0 3],'k-'); 
axis([-4 4 0 3])
set(gca,'fontsize',14);
set(h(1),'linewidth',2);
xlabel('{\bf t}');
ylabel('{\bf f(t)/g(t)}');

% Faltungskern  
J = @(p,s) (sin(0.5*(p+1)*s)./sin(0.5*s)).^4;
res = [];
for p=1:40
  Jn = @(x) J(p,x);
  Jnt = @(x) (x.*J(p,x));
  an = quad(Jn,0,pi,1E-8);
  bn = quad(Jnt,0,pi,1E-8);
  res = [res; p bn/an];
end

figure;
plot(res(:,1),res(:,2),'m+');
set(gca,'fontsize',14);
xlabel('{\bf p}');
title('{\bf Integral of tj_{n}(t) on [0,\pi]}');
