I am trying to find the function f[x] satisfying the condition
5 f[x] - (f'[x])^2 == x^2 + x + 4
I tried
DSolve[5 f[x] - (f'[x])^2 == x^2 + x + 4, f[x], x] // FullSimplify
I can not get the result for along time. How can I find it?
I am trying to find the function f[x] satisfying the condition
5 f[x] - (f'[x])^2 == x^2 + x + 4
I tried
DSolve[5 f[x] - (f'[x])^2 == x^2 + x + 4, f[x], x] // FullSimplify
I can not get the result for along time. How can I find it?
Try:
Block[{Integrate}, DSolve[5 f[x] - (f'[x])^2 == x^2 + x + 4, f[x], x] /. {Integrate -> Inactive[Integrate]}]
Or:
time = 1; res =
Block[{Integrate},
Function[expr, expr /. Integrate -> Inactive[Integrate]][
DSolve[5 f[x] - (f'[x])^2 == x^2 + x + 4, f[x], x]]];
pos = SortBy[Drop[Position[res, Inactive[Integrate]], 0, -1],
Minus@*Length];
Fold[MapAt[
TimeConstrained[Hold[# // Activate // Evaluate], time, #] /.
Integrate -> Inactive[Integrate] &, #, #2] &, res, pos] /.
Hold -> Identity
Transcendental equations can't be solved analytically.
An alternative to blocking Integrate is to set a time constraint on it (see Why Can't `DSolve` Find a Solution for this ODE?).
ClearAll[withTimedIntegrate];
SetAttributes[withTimedIntegrate, HoldFirst];
withTimedIntegrate[code_, tc_] := Module[{$in},
Internal`InheritedBlock[{Integrate},
Unprotect[Integrate];
i : Integrate[___] /; ! TrueQ[$in] :=
Block[{$in = True},
TimeConstrained[i, tc, Inactivate[i, Integrate]]
];
Protect[Integrate];
code
]
];
withTimedIntegrate[
DSolve[5 f[x] - (f'[x])^2 == x^2 + x + 4, f[x], x],
5]
(* long implicit solution Solve[...] with unevaluated integrals *)
There are two polynomial solutions: $f[x]=1+x+x^2$ and $f[x]=(13+4x+4x^2)/16$.
Define $f[x]=a x^2 + b x +c$ and equate coefficients...
finto a base of acceptable functions. – Daniel Huber Mar 25 '21 at 17:21