<s> from sympy . sandbox . indexed_integrals import IndexedIntegral <EOL> from sympy import IndexedBase , Idx , symbols , sin , cos <EOL> def test_indexed_integrals ( ) : <EOL> A = IndexedBase ( '<STR_LIT:A>' ) <EOL> i , j = symbols ( '<STR_LIT>' , integer = True ) <EOL> a1 , a2 = symbols ( '<STR_LIT>' , cls = Idx ) <EOL> assert isinstance ( a1 , Idx ) <EOL> assert IndexedIntegral ( <NUM_LIT:1> , A [ i ] ) . doit ( ) == A [ i ] <EOL> assert IndexedIntegral ( A [ i ] , A [ i ] ) . doit ( ) == A [ i ] ** <NUM_LIT:2> / <NUM_LIT:2> <EOL> assert IndexedIntegral ( A [ j ] , A [ i ] ) . doit ( ) == A [ i ] * A [ j ] <EOL> assert IndexedIntegral ( A [ i ] * A [ j ] , A [ i ] ) . doit ( ) == A [ i ] ** <NUM_LIT:2> * A [ j ] / <NUM_LIT:2> <EOL> assert IndexedIntegral ( sin ( A [ i ] ) , A [ i ] ) . doit ( ) == - cos ( A [ i ] ) <EOL> assert IndexedIntegral ( sin ( A [ j ] ) , A [ i ] ) . doit ( ) == sin ( A [ j ] ) * A [ i ] <EOL> assert IndexedIntegral ( <NUM_LIT:1> , A [ a1 ] ) . doit ( ) == A [ a1 ] <EOL> assert IndexedIntegral ( A [ a1 ] , A [ a1 ] ) . doit ( ) == A [ a1 ] ** <NUM_LIT:2> / <NUM_LIT:2> <EOL> assert IndexedIntegral ( A [ a2 ] , A [ a1 ] ) . doit ( ) == A [ a1 ] * A [ a2 ] <EOL> assert IndexedIntegral ( A [ a1 ] * A [ a2 ] , A [ a1 ] ) . doit ( ) == A [ a1 ] ** <NUM_LIT:2> * A [ a2 ] / <NUM_LIT:2> <EOL> assert IndexedIntegral ( sin ( A [ a1 ] ) , A [ a1 ] ) . doit ( ) == - cos ( A [ a1 ] ) <EOL> assert IndexedIntegral ( sin ( A [ a2 ] ) , A [ a1 ] ) . doit ( ) == sin ( A [ a2 ] ) * A [ a1 ] </s>
