@@ -99,7 +99,7 @@ function integrate(eq, x = nothing;
9999
100100 plan = NumericalPlan (abstol, radius, complex_plane, opt)
101101
102- s, u, ε = integrate_sum (eq, x; plan, bypass, num_trials, num_steps,
102+ s, u, ε = integrate_term (eq, x; plan, bypass, num_trials, num_steps,
103103 show_basis, symbolic, max_basis, verbose, use_optim)
104104
105105 s = beautify (s)
@@ -226,14 +226,7 @@ function integrate_term(eq, x; kwargs...)
226226 end
227227
228228 if symbolic
229- y = integrate_symbolic (eq, x; plan)
230- if y == nothing
231- if has_sym_consts
232- @info (" Symbolic integration failed. Try changing constant parameters ([$(join (params, " , " )) ]) to numerical values." )
233- end
234-
235- return 0 , eq, Inf
236- end
229+ return try_symbolic (eq, x, has_sym_consts, params)
237230 end
238231
239232 eq = cache (eq)
@@ -308,6 +301,20 @@ function try_integrate(eq, x, basis; plan = default_plan())
308301 return solve_sparse (eq, x, basis; plan)
309302end
310303
304+ function try_symbolic (eq, x, has_sym_consts = false , params = []; plan = default_plan ())
305+ y = integrate_symbolic (eq, x; plan)
306+
307+ if y == nothing
308+ if has_sym_consts && ! isempty (params)
309+ @info (" Symbolic integration failed. Try changing constant parameters ([$(join (params, " , " )) ]) to numerical values." )
310+ end
311+
312+ return 0 , eq, Inf
313+ else
314+ return y, 0 , 0
315+ end
316+ end
317+
311318function deprecation_warnings (; use_optim = false , homotopy = true )
312319 if use_optim
313320 @warn (" use_optim is deprecated and will be removed in a future version" )
0 commit comments