human
Here's a good function header given the following:
I wrote the below code

    from sympy.solvers.solveset import linsolve
    a = symbols(('a:%d' % order))
    def _makeDE(k):
        eq = (f.diff(x, k) + Add(*[(a[i] * f.diff(x, i)) for i in range(0, k)]))
        DE = (g(x).diff(x, k) + Add(*[(a[i] * g(x).diff(x, i)) for i in range(0, k)]))
        return (eq, DE)
    (eq, DE) = _makeDE(order)
    found = False
    for k in range(1, (order + 1)):
        (eq, DE) = _makeDE(k)
        eq = eq.expand()
        terms = eq.as_ordered_terms()
        ind = rational_independent(terms, x)
        if (found or (len(ind) == k)):
            sol = dict(zip(a, (i for s in linsolve(ind, a[:k]) for i in s)))
            if sol:
                found = True
                DE = DE.subs(sol)
            DE = DE.as_numer_denom()[0]
            DE = DE.factor().as_coeff_mul(Derivative)[1][0]
            (yield (DE.collect(Derivative(g(x))), k))

What's a good function header?
assistant
#Here's a good function header.

def simpleDE(f, x, g, order=4):