(*"
* Solves y''[x] == F[y[x], y'[x]] if LHS is integrable w.r.t x
"*)
DownValues@mySpecialOrder2BVP = {
HoldPattern[
mySpecialOrder2BVP[eqn_, ycond_, yprimecond_, a_, y_, x_]] :>
Block[{rhs, w, res1, c, res},
rhs = eqn[[2]] /. (**) {y[x] | y'[x] -> w}(**);
(res1 =
Quiet[Solve[ (**)
Derivative[1][y][x] == Integrate[eqn[[2]], x](**) + c /.
x -> a /. {ycond, yprimecond}, c]];
(res1 = (**)
Derivative[1][y][x] ==
Integrate[eqn[[2]], x](**) + (c /. res1[[1]]);
res = (**)
DSolve[res1 && ycond[[1]] == ycond[[2]], {y}, {x}]; (**)
res /; FreeQ[res, $Failed](**)DSolve(**)]) /;
MatchQ[res1, {{c -> m_}}] && FreeQ[res1, Integrate]) /;
FreeQ[rhs, y | x]]
};
mySpecialOrder2BVP[ode, Sequence @@ First@Solve[ic], 3, y, x]
(* {{y -> Function[{x}, -Log[4 - x]]}} *)
I don't have a way to hook this into DSolve
automatically.
Edit notice: I neglected to mark the change from the internal DSolve`DSolveParser
to DSolve
. DSolveParser[]
threw a couple of Part::partw
errors that could be ignored. Calling the top-level DSolve
seemed the best fix for this answer. The Condition
should therefore be FreeQ[res, DSolve]
. It seems to me that the errors are but that arise because the internal SpecialOrder2BVP[]
hasn't been updated to pass DSolveParser[]
complete option value data (with the new options like IncludeSingularSolutions
). I haven't noticed anyone reporting such a bug yet, though. (Also, I don't know why Integrate
is called twice. It seems wasteful.)