Mathematica Homework Question

157 Views Asked by At

I had a mathematica assignment the other day that was fairly simple. I thought I did it correctly, but I guess not.

Question: Write a single Mathematica Command which will display (plot) both $y = x\sin(2x + \pi)$ and $y = e^x$ on a single set of axes with $x$ in the interval $-7 \le x \le 5$

I had put:

Plot[{xsin[2x + Pi], e^x}, {-7, x, 5}]

Could anyone explain what's wrong? Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

You need a space between x Sin. Capitalize Sin (its a function) and the range for variable x is given as {variable NAME, lower BOUND, upper BOUND}

Plot[{x Sin[2 x + Pi], E^x}, {x, -7, 5}]

edit and you need 'E' to get the constant e in Mathematica.