Temperature gradients (TGs) provide an effective approach to controlling solvated molecules and creating spatiotemporally varying thermal stimuli for biochemical research. Methods developed to date for generating TGs can only create a limited set of static temperature profiles. This article describes a method for establishing dynamic free-form TGs in polydimethylsiloxane (PDMS) as well as in gases and liquids in contact with the PDMS. The heating mechanism relies on the efficient acoustic absorption by the PDMS of high-frequency (5-200 MHz) surface acoustic waves (SAWs). MATLAB-aided actuation of a transducer enabled the generation and propagation of SAWs in a controlled fashion, which permitted spatiotemporal control over the temperature in the PDMS microstructures. This technique is exploited to perform one-shot high-resolution melting (HRM) analysis to detect single nucleotide polymorphisms (SNPs) in DNA. The experimental results displayed a 10-fold higher resolution and an enhanced signal-to-noise ratio compared to the results obtained using a conventional real-time PCR machine.