3

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?

minhthien_2016
  • 3,347
  • 14
  • 22

3 Answers3

4

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

Solution by Maple 2021: enter image description here

Transcendental equations can't be solved analytically.

Mariusz Iwaniuk
  • 13,841
  • 1
  • 25
  • 41
4

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 *)

Michael E2
  • 235,386
  • 17
  • 334
  • 747
4

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...

KennyColnago
  • 15,209
  • 26
  • 62