$y''+y\ln(1+x)=x+e^x$ 
Seriously, I have no idea about the defintion of maximal unique solution for 2nd order ODE as asked in the asked and what $J$ it is asking? 
I did a lot of research about it and came across only first order ODE with maximal solutions examples on internet, which I dont understand them also. :(
 A: You should be able to apply the theorem for the existence of a local solution of an  IVP $y'=f(x,y)$, $y(x_0)=y_0$, $f:\Bbb R\times \Bbb R^n\supset D\to\Bbb R^n$. There are two variants that can be relevant here.

Theorem (existence 1) If $f$ is continuous and locally $y$-Lipschitz, then the IVP has a local solution $y:(x_0-h,x_0+h)\to\Bbb R^n$ which is unique for this interval.

This is the usually presented version with a proof that uses a straight-forward application of the Banach fixed-point theorem. 

Theorem (existence 2) If $D=(a,b)\times \Bbb R^n$ and $f$ is globally Lipschitz on $D$, then the IVP has a unique maximal solution $y:(a,b)\to\Bbb R^n$.

The proof of this version requires either a modified supremum norm on the space of continuous functions, or a modified fixed-point theorem.

To apply the given second order linear DE, you have to formulate it as a first order system $u'=Au+b$, $u=(u_0,u_1)=(y,y')$,
$$
\pmatrix{u_0'\\u_1'}=\pmatrix{0&1\\-\ln(1+x)&0}\pmatrix{u_0\\u_1}+\pmatrix{0\\x+e^x}
$$
Over each closed interval $I=[a,b]$ where $A(t),b(t)$ are continuous, this has the $u$-Lipschitz constant $L=\max_{x\in I}\|A(x)\|$. This then results in the existence theorem for linear DE, if $A(t),b(t)$ are continuous over the interval $(\alpha,\beta)$, then the IVP with $x_0$ in that interval also has a solution with domain $(\alpha,\beta)$. As the domain of the ODE can not contain any points of discontinuity, no solution can extend over a discontinuity of the coefficient functions.

On the space of solutions of an IVP, which are pairs of domain interval and solution function over it, one can introduce a semi-order by inclusion. Two solutions are comparable if the domain of one is a subset of the domain of the other. The uniqueness then implies that the first is a restriction of the second solution. Any two solutions have a glued-together solution that is superior to both.

Definition The maximal solution is then the maximum of this semi-order, the solution of the IVP with the largest domain.

The main theorem to indirectly characterize a maximal solution is

Theorem (maximal solution and boundary of domain) For an ODE on domain $D$ any maximal solution of an IVP leaves any compact subset $K\subset D$ inside the (open) domain.

The most common applications of this theorem are when the compact set $K$ is a box or cylinder. 

For a scalar higher order linear DE as the given one, normalized to have leading coefficient $1$, this tells you that the maximal domain of a solution of the IVP is the maximal sub-interval of the joint domain over which the coefficients are continuous containing the initial point $x_0$. Now the maximal interval where $\ln(1+x)$ exists and is continuous is ...

The power series solution, inside the radius of convergence, extends naturally to a solution of the ODE over $\Bbb C$. This in turn means that also the complex singularities give bounds to the disk of convergence (in that they have to be outside). That is, the radius of convergence of the solution is the minimum of the radii of convergence of the series expansions of the coefficients of the normalized equation. These singularities are generated by the singularities of the coefficients. Fortunately the only singularity of the coefficients of the given ODE, the ones of $\ln(1+x)$, are real.
A: If the ODE is $y'' + a y = b$ with initial conditions given at $0$ and the functions $a, b$ are continuous on an interval containing $0$, then there exists a unique solution on that interval. So there is a unique solution on $(-1, \infty)$.
Further, if $a$ and $b$ are complex analytic at $0$, the solution is also analytic at $0$. If $S$ is its power series expansion around $0$, then the radius of convergence of $S$ is not less than the distance to the nearest singularity of $a$ or $b$. So $S$ converges at least on $(-1, 1)$.
Suppose the radius of convergence is greater than $1$. Then $S$ is analytic at $-1$ and $a = (x + e^x - S'')/S$ is meromorphic at $-1$, which gives a contradiction since we have $a = \ln(x + 1)$.
The unique solution on $(-1, \infty)$ cannot be continued to $x \leq -1$ since $f(x, y) = a y$ becomes undefined. If we allow complex-valued solutions and define $f(x, 0) = 0$, then the question is more subtle because we have to rule out non-analytic $C^2$-solutions, which may satisfy the ODE on a larger interval.
