WKB approximation in application to acoustic–gravity waves