FIGS. 5A to 5C are views showing a semiconductor optical device according to a third embodiment of the present invention, in which FIG. 5A is a schematic cross-section, FIG. 5B is a plan layout diagram, and FIG. 5C is schematic pattern diagrams of diffraction gratings.