1.2.4 Transform to \(u'=F(x)+u^2\). remove linear term. section 3-1-3 in Murphy
riccati_solver_3_1_3 :=proc(ode) 
    -- transform y' = f0 + f1 y + f2 y^2 to u'=F(x)+u^2 by removing linear term 
    -- to transform to either 3-2 (reduced, y'=c x^m + b y^2) 
    -- or 3-3 form (x y' = c x^n + a y - b y^2) 
 
    -- this is (a) in section 3-1-3 
    Let y=u exp(phi), phi=INT(f1,x). ode becomes  u'=F(x)+G(x) u^2 -- (i) 
        where F=f0 exp(-phi), G=f2 exp(phi) 
 
    IF F(x) is propertional to G(x) THEN 
       ode u'=F(x)+G(x) u^2 is separable 
       -- example u' = 3 x + 6 x u^2, becomes u' = x( 3 + 6 u^2) 
    ELSE 
        IF G is constant THEN 
            IF F(x) = c x^m THEN 
                 -- this is reduced riccati. Solved. 
            ELIF F(x) is polynomial of x with more than one term (say x+x^2) THEN 
                IF degree of F(x) is odd (say u'=x+x^3 + b u^2) THEN 
                    NO SOLUTION exist 
                ELSE degree of F(x) is even (say u'=x+x^2 + b u^2) THEN 
                    SOLUTION can exist. see Murphy page 17 
                END IF 
            ELSE 
                -- transform to second order and try 
            END IF 
        ELSE 
            -- transform to second order and try 
        END IF 
    END IF 
 
    IF still not solved THEN 
        Let y=u-v, where v=f1/(2*f2). ode becomes  u'=F(x)+G(x) u^2 -- (ii) 
            where F=f0+v'-f1^2/(4 f2), G=f2 
 
        Try same as above. 
    END IF 
 
    IF still not solved THEN 
        Let y=u(z) exp(phi), phi(x)=INT(f1,x), z=-INT(h exp(phi),x) --(iii) 
        ode becomes  u'(z)=F(z)-u^2(z), with F(z)=-f_0 exp(-2 phi) 
 
        Try same as above. 
    END IF 
 
    -- this is (b) in section 3-1-3 
    IF still Not solved THEN -- look at relations between coefficients. 
        -- case i 
        Try to find a,b with  |a|+|b|>0 s.t. (a^2 f0+ a b f1 + b^2 f2) = 0 
        IF a/=0 then y1=b/a is particular solution of Riccati THEN 
            SOL:= riccati_solver_3_1_1() using this y1 to find general solution. 
        ELIF f0+f1+f2=0 THEN 
            a=1,b=1 and y1=1.?? 
            SOL:= riccati_solver_3_1_1() using this y1 to find general solution. 
            -- But this does not seem correct. Example 
            -- y' = x -1/2 y -1/2 y^2. But y1=1 does not satisfy this ode?? 
        END IF 
 
        -- case ii -- need to make example 
        IF f0= A^2 f2 exp(2 INT(f1,x)) THEN 
            IF f0 f2>0 THEN 
               SOL := SQRT(f0/f2)  tanh( INT( SQRT(f0 f2),x) + constant ) 
            ELSE 
               SOL := SQRT(-f0/f2)  tan( INT( SQRT(-f0 f2),x) + constant ) 
            END IF 
        END IF 
 
        try case iii 
            -- to do 
    END IF 
END PROC