# Displaying a matrix with integral entries

I have a matrix nxn with coefficients a[i,j] like:

a[i,j]=NIntegrate[T[r], {r, -le, le}] - NIntegrate[T[r] Abs[r]/le, {r, -le, le}]


I can solve the matrix but I want to know if there is a method to show the matrix simbolically before the solve. Then I don't want to see only the end solution but even the composition of the matrix with the integrals for extended. Is it possible?

• What do you mean by "solve"? I don't see any equation! Jul 9 '15 at 14:15
• Are all entries equal? Jul 9 '15 at 14:19
• no, the a[i,j] are different. I posted here only a term . for "solve" I mean that I don't want that mathematica solves the Nintegral in the coefficient. At the end I obtain a matrix like: [{1,3,5},{3,1,4},{5,4,1}]. but i want to see the matrix composed by integral Jul 9 '15 at 14:20

You're going to have to write a separate function that uses Integrate instead of NIntegrate if you want something that looks like a matrix of traditional integrals, which is what I think you want. You also need to use HoldForm to keep the integral from evaluating. You also need someway to set the values that you want in the held version of the expression. I've used With, someone else may have a better idea. Without this you'll get the symbol used as the table iterator in your integral.

Table[
With[{f = i, g = j},
HoldForm@Integrate[x, {x, f, g}]]
, {i, 1, 4}
, {j, 1, 4}
] // MatrixForm


gives:

• thank you!!!! this is what i was looking for! Jul 9 '15 at 14:38
• What I have noticed is m.n would "work" to produce a meaningful result for matrices m and n but m//MatrixForm . n//MatrixForm does not compute. This would seem to be not explicit in the documentation? Jul 9 '15 at 15:12
• MatrixForm is a formatting function that produces readable output. You don't want to do calculations on lists that you've applied MatrixForm to. Jul 9 '15 at 15:37
• @diana since this answer seems to solve your problem, you might want to accept it by clicking on the gray check mark next to it. Jul 11 '15 at 3:29
• @MarcoB thank you I dind't know it! Jul 11 '15 at 8:37