Question

Suppose I have the (simplified), differential equation

de:=diff(f(x),x,x,x)=1;

I do have two boundary conditions, e.g. f(-1)=0 and f(1)=0. However, the third integration constant should obey the integral condition int(f(x),x=-1..1)=0.

I know how to deal with the regular boundary conditions, i.e.

 ans:=dsolve({de,f(1)=0,f(-1)=0});

But, how do I deal with the integral condition?

I tried something like

ans:=dsolve({de,f(1)=0,f(-1)=0,int(f(x),x=-1..1)=0});

But this does not solve the differential equation:

Error, (in dsolve) the input system cannot contain equations in the arbitrary parameters alone; found equation: int(f(x),x = -1 .. 1,AllSolutions)

My problem does have a solution with an additional step:

solve(int(rhs(ans),x=-1..1)=0);

But, I would like to supply this condition right in dsolve. How to do this?

Was it helpful?

Solution

Increase the order by 1. That is, let F represent the antiderivative of f (integrated from -1) and include it in the call to dsolve along with two initial conditions on F based on the integral.

eval(
     f(x),
     dsolve({
          diff(f(x),x$3)=1, f(-1)=0, f(1)=0,
          diff(F(x),x)=f(x), F(-1)=0, F(1)=0
     })
); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top