Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 x x
cosx is
yx
x
x
sinx C with y C
The goal of this exercise is to write a script file to plot the solutions to the differential equation
in the interval x with initial conditions y
The script file should have the structure scriptfunction similarly to the Mfile myplotm
Example Call the file exm The function that defines yx must be included in the same file
note that the function defining yx will have two input arguments: x and C
Your Mfile should have the following structure fill in all the with the appropriate commands:
x ; define the vector x in the interval
y f ; compute the solution with C
y f ; compute the solution with C
y f ; compute the solution with C
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started