ReplaceAll

Consider the differential equation y’(x) = n*sin(n*x) with the initial condition y(0) = -1.

Step 1

a) Write the above differential equation into Mathematica for the case n=1, and check your code is working.

b) Make a function depending on n for the general case.

Step 2

Use table to make a list of replacement rules for n from 0 to 5.

Step 3

Change the replacement rules into functions.

Step 4

a) Make a plot of your solutions over the range 0 to 4π.

b) Make a plot that only includes the case for n=3.