Here is my code:
% 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 the first solution:");
simplify(subs(eq_primitive,y,sol_y1))
disp("Verifying the primitive for the second solution:");
simplify(subs(eq_primitive,y,sol_y2))
% C=xvC=0 output is really C == x|C == 0, I do not know what this means
% perhaps element wise 'or'
% 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
Here is my output
diff(y(x), x)
General Solution:
[sym(0); sym(1/2) + x/4]
Verifying the primitive for the first solution:
C == x|C == 0
Verifying the primitive for the second solution:
(2 - 4*C + x)^2 == 16*C*x
Values of C
[sym(1); sym(4)]
Integral curves equations:
(y(x) - 1)^2 == x
(y(x) - 4)^2 == 4*x