Message Boards Message Boards


How to type in Mathematica

Posted 10 years ago
2 Replies
0 Total Likes
I have the following problem
Let dy/dx =|x|
Let y=g(x) the particular solution that verifies g(-1)=7/2, that calls integrate g(x) dx from -2 to 2, the problem is I have no idea how to enter in the program, Can somebody help me?
POSTED BY: Luis Ledesma
2 Replies
Posted 10 years ago
Many thanks  Marco, today I learned more of Mathematica,  I can solve in paper, but I do not know in Mathematica,.   Thanks to you I learned
POSTED BY: Luis Ledesma
Dear Luis,

I am not sure whether this is what you need.
sols = DSolve[{y'[x] == Piecewise[{{-x, x < 0}, {x, x >= 0}}], y[-1] == 7/2}, y[x], x]

Note, that the use of Piecewise, which works better than Abs here. You can then plot
Plot[y[x] /. sols, {x, -10, 10}]

Then you can integrate
Integrate[y[x] /. sols, {x, -2, 2}]

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract