To see the path on your system, type:
echo $PATH
The path can be set in any of several places, and on my system it's:
/etc/profile
/etc/profile.d/*
/etc/bashrc
/home/jjs/.profile
/home/jjs/.bashrc
To edit your own path, edit your .bashc file and add this line to the end:
export PATH=$PATH:/usr/local/comsol40a/bin/comsol
Then log out and log in again, or simply type ". .bashrc" which will
have the same effect in that current shell session, as it will add the
location of the comsol binary to your path.