#Nathan Fox #Homework 20 #I give permission for this work to be posted online Help:=proc(): print(` BVPexact(Oper,D1,f,x,a,b,Ini,Fini,x1) `): end: ##PROBLEM 1## #BVPexact(Oper,D1,f,x,a,b,Ini,Fini,x1): #uses dsolve to find the EXACT value of u(x1) where u(x) is a #solution of the ODE Boundary value problem #Oper(D1)u(x)=f(x) , u(a)=Ini[1], u'(a)=Ini[2], ...; #u(b)=Fini[1], u'(b)=Fini[2], ... #Oper is a differential operator written as a polynomial in D1, #D1 is the symbol for the differentiation opeator, f is an #expression in the variable x, that stands for the function f(x), #a, b, are numbers with a 0 then return diff(u, x$n): else return u: fi: end: D2:=proc(u, x, n) if n = 0 then return u: else return D(D2(u, x, n-1)): fi: end: return subs(x=x1, op(dsolve({add(coeff(Oper, D1, n)*diff2(u(x), x, n), n=0..degree(Oper, D1))=f, seq(D2(u, x, n)(a)=Ini[n+1], n=0..nops(Ini)-1), seq(D2(u, x, n)(b)=Fini[n+1], n=0..nops(Fini)-1)}, u(x)))[2]): end: #BVPexact(D1^2+1,D1,x^3,x,0,1,[3/2],[5/2],1/2); returned -3/2*sin(1/2)*(-5+cos(1))/sin(1)+3/2*cos(1/2)-23/8 #BVPexact(D1^4+3*D1^3+2*D1+1,D1,x^5+1,x,0,1,[1,2],[2,3],1/2); took too long (even with floating point)