Group Abstract Group Abstract

Message Boards Message Boards

Solve simple differential equation?

Posted 9 years ago
POSTED BY: Adrien Guyader

In[2]:= DSolve[{y'[x] == x*Log[x], y[1] == 1}, y[x], x] Out[2]= {{y[x] -> 1/4 (5 - x^2 + 2 x^2 Log[x])}}

In[3]:= Dimensions[%]
Out[3]= {1, 1}

and that works

In[5]:= Clear[a]
a = DSolve[{y'[x] == x*Log[x], y[1] == 1}, y[x], x];

In[7]:= a[[1]] 
Out[7]= {y[x] -> 1/4 (5 - x^2 + 2 x^2 Log[x])}

In[11]:= g[q_] := (y[x] /. a[[1]]) //. x -> q

In[12]:= g[1]
Out[12]= 1

enter image description here

Observe the SetDelayed in the definition of g and how the variable q enters after the replacement.

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard