How to solve this integral in Mathematica
Is it possible to solve it numerically?
$$\begin{align} \int_{-1}^1 \cos\big(&(.75-.75x^2)\cdot y_1 + (.25 - .5x - .75x^2) \cdot y_2 \\ + &(-.5x + .5x^3) \cdot y_3 + (.125 - .75 x^2 + 0.625 x^4) \cdot y_4 \big) dx \end{align}$$
The short answer is No.
You can't have undefined symbols/variables in numerical integrals.
If you want a purely numerical solution, you could make a 4-dimensional grid that covers the range of $y_i$ that you're interested in, do the integrals at those points and interpolate between the results.
Or, more simply, just define a numerical integral function that you can call when ever you need the result (it's a simple integral, so it is quite fast).
You can then plot any section of the 4D function that you want. For example and no particular reason,
More interesting (to me) is how far you can get with this integral analytically. If you didn't have any $x^3$ or $x^4$ terms, then integral can be done completely in terms of Fresnel C and S functions (W|A).
In general, it is a little more tricky. You could try a series expansion:
The SeriesCoefficient returns a DifferenceRoot expression - i.e., it can't be given in "closed form". Mathematica is then unable to compute the commented out
Sum. However, you can get the expansion of the result to any order, theTablecommand returnsIf you think about
abeing dimensionless,bhaving dimension one, ...,ehaving dimension 4, then each term is of a fixed dimension. Note that odd terms in the series vanish (because of the symmetry of the integral).This result can then be specialized to your particular values, e.g.,
a = .75 y1 + .25 y2 + .125 y4, etc...