
Ayers 'Differential Equations Problem 4
Show older comments
Could you help me do this in MatLab , I have figured it out with paper and pencil, Ayer's Schaums Outline Problem 4 , I've tried putting the differential into dsolve but cannot prove the primitive or find the solution Ayers gets.
4. Show that (y-C)^2=Cx is the primitive of the differential equation 4x (dy/dx)^2+2x dy/dx-y = 0 and find the equations of the integral curves through the points x=1 y=2
Here 2(y-C)*dy/dx = C and dy/dx=C/(2(y-C))
Then (4xC^2)/(4(y-C)^2) + (2xC)/(2(y-C)) - y = (C^2x+Cx(y-C)-y(y-C)^2)/(y-C)^2 = (y[Cx-(y-C)^2])/(y-C)^2 = 0
When x=1,y=2: (2-C)^2 = C and C = 1,4
The equations of the integral curves through (1,2) are (y-1)^2 = x and (y-4)^2 = 4x
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% My own commentary
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The primitive is given as (y-C)^2=Cx
derivative of (y-C)^2 = -2C+2y = 2(y-C), derivative of Cx = C*1 =C
He puts the derivative of the unknown function which is dy/dx, as a factor in the primitive
derivative of (y-C)^2 * dy/dx = derivative of Cx thus: 2(y-C) * dy/dx = C
Now solve for dy/dx : divide each side by 2(y-C) which cancels 2(y-C) on the right :
dy/dx = C/2(y-C) then (dy/dx)^2 = C^2/(2(y-C))^2 = C^2/(4( y-C)^2)
Now plug the coordinates x=1 y=2 into (y-C)^2 = Cx : (2-C)^2 = C*1 which is
(2-C)^2 = C , (2-C)(2-C)=C : 4-2C-2C+C^2 = C : 4-4C+C^2=C :
C^2-4C+4 =C : -4C and 4 to the right C^2=C+4C-4 : C to the left
C^2-C=4C-4, 4C to the left C^2-4C-C=-4 collect common terms left C^2-5C = -4
which is quadratic, complete the square :
C^2-5C+2.5^2 = -4+2.5^2
(C-2.5)^2 = -4+6.25
(C-2.5)^2 = 2.25 , square root each side
C-2.5 = + - SquareRoot(2.25)
C = +1.5+2.5 or -1.5+2.5
C = 4 or 1
The Differential equation was given as : 4x * C^2/4(y-C)^2 + 2x * C/2(y-C) -y = 0
combine 4x and 2x with respective numerators (4x*C^2)/(4(y-C)^2) + (2x*C)/2(y-C) - y = 0
cancel 4 and 2 1st and 2nd fractions left side xC^2/(y-C)^2 + xC/(y-C) - y = 0
common denominator (y-C)^2
C^2x/(y-C)^2 + Cx(y-C)/(y-C)^2 - y(y-C)^2/(y-C)^2 = 0
Combine numerators (C^2x+Cx(y-C)-y(y-C)^2)/(y-C)^2 = 0
The Cx(y-C) term in numerator can be factored Cxy-CxC
(C^2x+Cxy-CxC-y(y-C)^2)/(y-C)^2 = (C^2x+Cxy-C^2x-y(y-C)^2)/(y-C)^2 = 0 cancel C^2x
(Cxy-y(y-C)^2)/((y-C)^2) factor Cxy and y(y-C)^2 = (y(Cx-(y-C)^2)/(y-C)^2
Answers (2)
syms x y(x) C
% Define the differential equation
dy_dx = diff(y, x);
ode = 4*x*dy_dx^2 + 2*x*dy_dx - y == 0;
% Solve the differential equation
sol = dsolve(ode);
% Display the general solution
disp('General Solution:');
disp(sol);
% Verify that (y - C)^2 = Cx is the primitive
eq_primitive = (y - C)^2 == C*x;
% Substitute the general solution into the primitive equation
sol_y1 = sol(1);
sol_y2 = sol(2);
disp('Verifying the primitive for first solution:');
simplify(subs(eq_primitive, y, sol_y1))
disp('Verifying the primitive for second solution:');
simplify(subs(eq_primitive, y, sol_y2))
% Find the equations of the integral curves through the points (x = 1, y = 2)
x_val = 1;
y_val = 2;
C1 = solve(subs((y - C)^2, {x, y}, {x_val, y_val}) == C*x_val, C);
disp('Values of C:');
disp(C1);
% Integral curves equations
disp('Integral curves equations:');
for i = 1:length(C1)
eq_curve = (y - C1(i))^2 == C1(i)*x;
disp(eq_curve);
end
4 Comments
Joseph Palumbo
on 21 May 2024
Edited: Joseph Palumbo
on 22 May 2024
Joseph Palumbo
on 22 May 2024
Joseph Palumbo
on 22 May 2024
Joseph Palumbo
on 22 May 2024
Categories
Find more on Equation Solving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
