Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

And so I want to solve the following equation, subject to these initial conditions:

$\ u_{tt} - u_{xx} = 6u^5+(8+4a)u^3-(2+4a)u$

$\ u(0,x)=\tanh(x), u_t(0,x)=0$

When I use NDSolve to solve within the intervals $\ [0,10] \times [-5,5]$, I tried this as a code:

   D[u[t, x], t, t] - D[u[t, x], x, x] ==
     6 u[t, x]^5 + (8+4a) u[t, x]^3 - (2+4a) u[t, x],
   u[0, x] == Tanh[x], D[u[0, x], t] == 0},
 u[t, x], {t, 0, 10}, {x, -5, 5}]

But Mathematica then returns the following line:

NDSolve::deqn: Equation or list of equations expected instead of True in the first argument

where the True affirmation seemingly refers to the second initial condition. What is it that I did wrong? Is there anything wrong with the code? Is there anything wrong with the problem?

share|improve this question
D[u[0, x], t] == 0 is trivially true because u[0,x] does not depend on t. To write the equation you mention, write it as Derivative[1, 0][u][0, x]. As a beginner as yet unfamiliar with Derivative, you could have constructed this expression as D[u[t, x], t] /. t -> 0, i.e. take the derivative first, and substitute the value t=0 only afterwards. –  Szabolcs Feb 4 '14 at 16:26

1 Answer 1

up vote 3 down vote accepted

Since u[x,0] does not depend on t differentiating leads to 0==0. It should be Derivative[1, 0][u][0, x] == 0 Also for your problem one needs some boundary conditions.

share|improve this answer
Now I'd love to be able to compute a numerical integral of the solution, or a function thereof... –  NSERC Protester Feb 6 '14 at 15:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.