Question: The general solution to the differential equation dy dx = 7 x + 1 1 x 2 + 1 2 cos ( x ) is

The general solution to the differential equation dy
dx =7x +11x
2+12 cos(x) is
y(x)=7
2
x
2+
11
3
x
3+12 sin(x)+ C with y(0)= C.
The goal of this exercise is to write a script file to plot the solutions to the differential equation
in the interval 0<= x <=9, with initial conditions y(0)=590,990,1480.
The script file should have the structure script+function (similarly to the M-file myplot2.m
Example 2). Call the file ex5.m. The function that defines y(x) must be included in the same file
(note that the function defining y(x) will have two input arguments: x and C).
Your M-file should have the following structure (fill in all the ?? with the appropriate commands):
x =?? ; % define the vector x in the interval [0,9]
y1= f (??) ; % compute the solution with C =590
y2= f (??) ; % compute the solution with C =990
y3= f (??) ; % compute the solution with C =1480
plot (??)% plot the three solutions with different line - styles
title (??)% add a title
legend (??)% add a legend
function y = f (x , C )
y =??% fill -in with the expression for the general solution
end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!