Skip to main content
EDIT
Source Link

As a first step I you can find numerical solutions.

Let us first repeat: the ODE is

eq = x'[t] == -x[t]^3 + Sin[t];

Mathematica does not find an analytic solution

DSolve[eq, x[t], t]

During evaluation of In[13]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

(* Out[13]= DSolve[Derivative[1][x][t] == Sin[t] - x[t]^3, x[t], t] *)

So now the numerical solution with which Mathematica has no difficulty:

Let's take 5 periods

tmax = 5 (2 \[Pi]);

The inital vaule can be chosen freely.

y0 = 0; (* other examples to try: 1,-1,5,-5 *)

The solution

sol = NDSolve[eq && x[0] == y0, x[t], {t, 0, tmax}];

xx[t_] = x[t] /. sol[[1]];

Plot of the soluton, together with a pure sine for comparison

Plot[{Sin[2 \[Pi] t], xx[2 \[Pi] t]}, {t, 0, tmax/(2 \[Pi])}, 
 PlotLabel -> 
  "Numerical solution of an ODE\nblue curve -> solution\nyellow curve -> pure \
sine"]

enter image description here

EDIT

It seems that the solution has the general form

f[t] = d[t] + p[t]

where d[t] is a function decaying with time and p[t] is a "universal" function with period 2 Pi. The initial conditions show up only in d[t].

As a first step I you can find numerical solutions.

Let us first repeat: the ODE is

eq = x'[t] == -x[t]^3 + Sin[t];

Mathematica does not find an analytic solution

DSolve[eq, x[t], t]

During evaluation of In[13]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

(* Out[13]= DSolve[Derivative[1][x][t] == Sin[t] - x[t]^3, x[t], t] *)

So now the numerical solution with which Mathematica has no difficulty:

Let's take 5 periods

tmax = 5 (2 \[Pi]);

The inital vaule can be chosen freely.

y0 = 0; (* other examples to try: 1,-1,5,-5 *)

The solution

sol = NDSolve[eq && x[0] == y0, x[t], {t, 0, tmax}];

xx[t_] = x[t] /. sol[[1]];

Plot of the soluton, together with a pure sine for comparison

Plot[{Sin[2 \[Pi] t], xx[2 \[Pi] t]}, {t, 0, tmax/(2 \[Pi])}, 
 PlotLabel -> 
  "Numerical solution of an ODE\nblue curve -> solution\nyellow curve -> pure \
sine"]

enter image description here

As a first step I you can find numerical solutions.

Let us first repeat: the ODE is

eq = x'[t] == -x[t]^3 + Sin[t];

Mathematica does not find an analytic solution

DSolve[eq, x[t], t]

During evaluation of In[13]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

(* Out[13]= DSolve[Derivative[1][x][t] == Sin[t] - x[t]^3, x[t], t] *)

So now the numerical solution with which Mathematica has no difficulty:

Let's take 5 periods

tmax = 5 (2 \[Pi]);

The inital vaule can be chosen freely.

y0 = 0; (* other examples to try: 1,-1,5,-5 *)

The solution

sol = NDSolve[eq && x[0] == y0, x[t], {t, 0, tmax}];

xx[t_] = x[t] /. sol[[1]];

Plot of the soluton, together with a pure sine for comparison

Plot[{Sin[2 \[Pi] t], xx[2 \[Pi] t]}, {t, 0, tmax/(2 \[Pi])}, 
 PlotLabel -> 
  "Numerical solution of an ODE\nblue curve -> solution\nyellow curve -> pure \
sine"]

enter image description here

EDIT

It seems that the solution has the general form

f[t] = d[t] + p[t]

where d[t] is a function decaying with time and p[t] is a "universal" function with period 2 Pi. The initial conditions show up only in d[t].

Source Link

As a first step I you can find numerical solutions.

Let us first repeat: the ODE is

eq = x'[t] == -x[t]^3 + Sin[t];

Mathematica does not find an analytic solution

DSolve[eq, x[t], t]

During evaluation of In[13]:= Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

(* Out[13]= DSolve[Derivative[1][x][t] == Sin[t] - x[t]^3, x[t], t] *)

So now the numerical solution with which Mathematica has no difficulty:

Let's take 5 periods

tmax = 5 (2 \[Pi]);

The inital vaule can be chosen freely.

y0 = 0; (* other examples to try: 1,-1,5,-5 *)

The solution

sol = NDSolve[eq && x[0] == y0, x[t], {t, 0, tmax}];

xx[t_] = x[t] /. sol[[1]];

Plot of the soluton, together with a pure sine for comparison

Plot[{Sin[2 \[Pi] t], xx[2 \[Pi] t]}, {t, 0, tmax/(2 \[Pi])}, 
 PlotLabel -> 
  "Numerical solution of an ODE\nblue curve -> solution\nyellow curve -> pure \
sine"]

enter image description here