def ode_nth_linear_euler_eq_nonhomogeneous_variation_of_parameters(eq, func, order, match, returns='sol'):
 x = func.args[0]
 f = func.func
 r = match
 gensol = ode_nth_linear_euler_eq_homogeneous(eq, func, order, match, returns='both')
 match.update(gensol)
 r[(-1)] = (r[(-1)] / r[ode_order(eq, f(x))])
 sol = _solve_variation_of_parameters(eq, func, order, match)
 return Eq(f(x), (r['sol'].rhs + ((sol.rhs - r['sol'].rhs) * r[ode_order(eq, f(x))])))

def ode_nth_linear_euler_eq_nonhomogeneous_variation_of_parameters ( eq , func , order , match , returns = 'sol' ) : x = func . args [ 0 ] f = func . func r = match gensol = ode_nth_linear_euler_eq_homogeneous ( eq , func , order , match , returns = 'both' ) match . update ( gensol ) r [ ( - 1 ) ] = ( r [ ( - 1 ) ] / r [ ode_order ( eq , f ( x ) ) ] ) sol = _solve_variation_of_parameters ( eq , func , order , match ) return Eq ( f ( x ) , ( r [ 'sol' ] . rhs + ( ( sol . rhs - r [ 'sol' ] . rhs ) * r [ ode_order ( eq , f ( x ) ) ] ) ) )
solves an nth order linear non homogeneous cauchy-euler equidimensional ordinary differential equation using variation of parameters .