function [u,auu] = analytickeReseni1d(k1,k2,a,l,f,u0,tau,x)

B = u0;
C = (tau+f*l)/k2;
A = (tau+f*l)/k1;
D = a*(1/k1-1/k2)*(-f*a/2+tau+f*l)+u0;

u = x;
idx = find(x<a);
u(idx) = -(f/2/k1)*x(idx).^2+A*x(idx)+B;
idx = find(x>=a);
u(idx) = -(f/2/k2)*x(idx).^2+C*x(idx)+D;

syms y
u1 = -(f/2/k1)*y^2+A*y+B;
u2 = -(f/2/k2)*y^2+C*y+D;
auu = double(k1*int(diff(u1,y)^2,y,0,a) + int(k2*diff(u2,y)^2,y,a,l));