I confirm that this can be done with BandMathX
in the command line, you need three inputs parameters
-il for the list of input images
-out for the name of output image. Note that you can use extended filenames and specify the output type, e.g.
-out "myOutput.tif?&gdal:co:COMPRESS=LZW&gdal:co:TILED=YES" uint8
the "easy" and most flexible way to write a multiple band output is to write the expression for each band individually, separated by a semi-colon. For example, with an RGB image, you can do :
-exp "(im1b1*d^2)/cos(e);(im1b3*d^2)/cos(e);(im1b3*d^2)/cos(e)"
of course, I assume that d and e are constant values, which you enter manually. They could also be store in another image, in this case you can refer to them as im2b1 and im3b1.
Alternatively, you can use vector operation with im1 (a row vector). This is shorter but you must use the right operators: mlt and dv to multiply/divide a vector by a scalar, mult and div to elementwise multiply/divide with a vector.
-exp "im1 mlt (d^2) dv cos(e)"
-exp "im1 mult {d^2,d^2,d^2} div {cos(e),cos(e),cos(e)}"