%Problem 1 of page 178 of  Turner
% General solution to y' = x/y
clc
clear all
close all
yprime=inline('x/y','x','y');
%General solution
ygen = vectorize(inline('sqrt(x*x + b)','x','b'));
xlo=0; xhi=4;
xvec = linspace(xlo,xhi,100);
b = 0;
indexhi=9;
for index = 1:indexhi
    yvec(index,:)= ygen(xvec,b);
    bvec(index,:) = num2str(b)  
    b = b+1;
end
plot(xvec,yvec)
xlabel ('x')
ylabel ('y(x)')
title ('General solution to y'' = x/y: y(x) = sqrt(x^2+b)')
legend(bvec,'Location','EastOutside')
