Arduino not running the sketch with external power supply of 9v, but runs the program when connected to pc
TX LED is blinking because of communication (indicating data transmit via serial). It will not blink if there are no communication from Arduino through USB cable.      

For simple observation, use LED_BUILTIN pin. Its a build in-LED indicator on Arduino.    

pinMode(LED_BUILTIN, OUTPUT);


then

digitalWrite(LED_BUILTIN, HIGH);
delay(500)
digitalWrite(LED_BUILTIN, LOW);
delay(500)


Arduino fail on external power supply is usually because of voltage drop or your system draw too much current.