%% Find Implicit Solution When No Explicit Solution Is Found
% If dsolve cannot find an explicit solution of a differential equation analytically, then it returns an empty symbolic array. You can solve the differential equation by using MATLAB® numerical solver, such as ode45. For more information, see Solve a Second-Order Differential Equation Numerically.

syms y(x)
eqn = diff(y) == (x-exp(-x))/(y(x)+exp(y(x)));
S = dsolve(eqn)

% Alternatively, you can try finding an implicit solution of the differential equation by specifying the 'Implicit' option to true. An implicit solution has the form F(y(x)) = g(x).

S = dsolve(eqn,'Implicit',true)

%
% Copyright 2019 The MathWorks, Inc.