Skip to main content

numerical integration - Integrals of a Fourth order differential equation: Part A


Is it possible for us to get the value for integrals of a Fourth order differential equation in MMA.


I attach the code that i have used in MMA:


eqn = 4 y''''[x] - 4 y''[x] + y[x] - 1;
sol1 = DSolve[{eqn == 0, y[0] == 0, y'[0] == 0, y'[1] == 0,

y''[1] == 0}, y[x], x];
y[x] = y[x] /. sol1;
eqn1 = (y'[x])^2 + (y''[x])^2 + (y[x] - 1)^2/4;
yys = Integrate[eqn1, {x, 0, 1}];
N[yys]

Thanks in advance!



Answer



Your code works fine if you change y[x] = to y[x_] =


Clear[y]


eqn = 4 y''''[x] - 4 y''[x] + y[x] - 1;
sol1 = DSolve[{eqn == 0, y[0] == 0, y'[0] == 0, y'[1] == 0,
y''[1] == 0}, y[x], x];
y[x_] = y[x] /. sol1[[1]];
eqn1 = (y'[x])^2 + (y''[x])^2 + (y[x] - 1)^2/4;
yys = Integrate[eqn1, {x, 0, 1}];
N[yys]

(* 0.249227 *)

Comments