3
$\begingroup$

I have a concern of why mathematica does not like/except the independent variable x. When it is used it gives the following error:

In[1]:= DSolve[{2 x''[t] + $6$ x'[t] + 5 x[t] == 0, x[0] == 10, x'[0] == 0}, x[t], t]

Gives

DSolve::deqn :

$\hspace{0.2cm}$ Equation or list of equations expected instead of True in the first argument

$\hspace{0.9cm}$ {$11$x[t]+$2$x''[t] == $0,~$ x[$0$]==$10,~$True}.

Out[1]= DSolve[{$11$x[t]+$2$x''[t]==$0,~$ x[$0$]==$10,~$ True}, x[t],$\:$ t]

But when the variable is switched out for another, you obtain the solution as expected like so:

In[2]:= DSolve[{2 s''[t] + 6 s[t] + 5 s[t] == 0, s[0] == 10, s'[0] == 0}, s[t], t]

Out[2]= $\Bigl\{\Bigl\{s\Bigl[t\Bigr] \rightarrow \text{10 Cos}\left[\sqrt{\dfrac{11}{2}}t \right]\Bigr\}\Bigr\}$

What could be the cause of this?

Note: I also cleared the variable from memory just to be on the safe side.

  • 2
    Maybe clearing x from memory doesn't clear x'? Try restarting the kernel.2012-01-05
  • 0
    What does ??x give?2012-01-05
  • 2
    (And did you mean to enter `6 x[t]+5 x[t]`, or should one of those be `x'[t]`?)2012-01-05
  • 0
    Whatever the answer, you can be sure that mathematica doesn't care about whether you call the independent variable x or s.2012-01-05
  • 0
    @JimBelk: Thanks! That worked out, now I am going to do this instead of keeping attempting to force a result from mathematica kernel when it wants to refresh its batteries. `:)`2012-01-05
  • 2
    Well, executing `Remove[x]` is a bit less drastic than kernel restarting...2012-01-05
  • 0
    @BrettChampion: Thanks for catching that. It produces a solution either with or without the prime term `x'[t]`. Just not the correct one. But all in all was not the reason for the warning message.2012-01-05
  • 0
    @J.M.: Thanks for that info.2012-01-05
  • 0
    I'm wondering how you made the output into LaTeX. Simply copying as LaTeX doesn't exactly give this. Did you edit it manually or do you have something automated?2012-01-09
  • 0
    @Szabolcs: I am getting the exact same output if that is what your inquiry is about, right? It's how did I get `Out[2]=` to look like that. What you do is 1) Highlight the math text of the output in your Mathematica user window and right click it. Next, 2) You will right click the highlighted area and choose `copy as` LaTeX. 3) Then just paste the code to where ever you need it to be. The only difference that I see from directly doing that and the one shown here in the question, is the sizing of constructs such as braces, brackets, and etc. This can be manually adjusted with commands such as:2012-01-11
  • 0
    @Szabolcs: `\bigl \bigr`, `\biggl \biggr`, `\Bigl \Bigr`, and `\Biggl \Biggr` and maybe others. You can click edit underneath the question to see the raw LaTeX code used, and play around with it to see how it changes below in the preview window pane. Just try not save any edits you make unless they are intended edits to make the questions better. This is the code generated directly by Mathematica when doing the following in the previous comment. `\left\{\left\{s[t]\to 10 \text{Cos}\left[\sqrt{\frac{11}{2}} t\right]\right\}\right\}`. Thanks2012-01-11

1 Answers 1

5

That's because you've just accidentally written x'[0]=0 instead of x'[0]==0. Try to clear this false assignment simply by evaluating:

x'[0]=. 

Then re-evaluate your original line.