How do I NIntegrate solutions to Differential Equations?

How do I use NIntegrate solutions to Differential Equations?

IntegratedDifferenceFunction[I_, O_] := 
 NIntegrate[I[U] - O[U], {U, 0, 2*Pi}]

m = DSolve[y''[x] + y[x] == 0, y[x], x]
n = DSolve[y''[x] + y'[x] == 0, y[x], x]

IntegratedDifferenceFunction[m, n]

I want to compute the difference between two Ordinary Differential Equation Solutions from 0 to 2*Pi, It can be any ODE’s. Is there also a way to apply the function for Numerical Solutions that were solved using NDSolve?

    m = NDSolve[y''[x] + y[x] == 0, y[x], {x,0,2*Pi}]
    n = NDSolve[y''[x] + y'[x] == 0, y[x], {x,0,2*Pi}]

Crossposted Here: https://mathematica.stackexchange.com/questions/265708/how-do-i-nintegrate-solutions-to-differential-equations

Do you perhaps mean something like this?

IntegratedDifferenceFunction[fi_, fo_] :=  NIntegrate[fi - fo, {x, 0, 2*Pi}]

g1 = DSolve[{y''[x] + y[x] == 0, y[0] == .8, y'[0] == -.2}, y, x]
g2 = DSolve[{y''[x] + y'[x] == 0, y[0] == .8, y'[0] == -.2}, y, x]
fgi = y[x] /. g1[[1, 1]]
fgo = y[x] /. g2[[1, 1]]
IntegratedDifferenceFunction[fgi, fgo]