The differential equation #y'''+y'=secx# is a linear non-homogeneous differential equation. The solution here can be composed as the addition of an homogeneous solution #y_h# plus a particular solution #y_p#. The homogeneous solution is easy to obtain. Considering #y_h= ce^(lambda x) #and substituting we get at
#c(lambda^3+lambda)e^(lambda x)=0#. with roots #{0,i,-i}# so the homogeneous solution has the structure
#y_h= c_1+c_2sin x+c_3cosx#. The obtention of the particular solution is more involved. In this case we will build a series approximated solution.
We will using the series #sec x approx 1 + x^2/2 + (5 x^4)/24 + (61 x^6)/720 + (277 x^8)/8064 + (
50521 x^10)/3628800 + (540553 x^12)/95800320 + (
199360981 x^14)/87178291200+cdots+#
Now making #y_p=sum_(k=0)^na_k x^k# we have to obey
#y'''_p+y'_p= 1 + x^2/2 + (5 x^4)/24 + (61 x^6)/720 + (277 x^8)/8064 + (
50521 x^10)/3628800 + (540553 x^12)/95800320 + (
199360981 x^14)/87178291200+cdots+#
Equating coefficients we get at
#{(a_1+6a_3=1),(a_3+20a_5=1/6),(a_5+42a_7=1/24),(a_7+72a_9=61/5040),(a_9+110a_11=277/(9 xx 8064)),(cdots):}#
Calling #a_1=c_0# and solving we have
#((a_3=1/6-c_0/6),(a_5=c_0/120),(a_7=1/1008-c_0/5040),(a_9=1/6480+c_0/362880),(a_11=443/13305600-c_0/3991680),(a_(13)=43/5443200+c_0/6227020800),(cdots))#
We considered obviously only the odd coefficients. The constant #c_0# is associated to the initial conditions.
Finally the solution reads
#c_1+c_2sin x+c_3cosx+a_1(c_0)x+a_3(c_0)x^3+a_5(c_0)x^5+ cdots +#
Here the error converges quickly to zero.